For some reason I am not able to upload images OR set the Featured Image on a custom post type in my custom wordpress theme.

I have added theme support of post-thumbnails to my functions.php file and my custom post type supports it. The link to add the featured image works and it allows me to start uploading the file. But before the file can complete it gives me the error message "An error occurred in the upload. Please try again later". If I visit the media library directly, the file is there, but it shows an error in the custom post page.

Also, when I open the media library from the custom post page it shows as empty.

Anyone out there have any thoughts on why this is?

  • Check the permissions on your uploads folder. Are you able to upload media in general? Can you attach featured images to your posts (ie, the WordPress post type)?
    – Pat J
    Commented Jun 17, 2013 at 2:10
  • I have checked that already. If I go to Media > Add New Media I can upload files just fine.
    – Reaction21
    Commented Jun 17, 2013 at 2:18
  • Deactivate all plugins. Does the problematic behaviour remain? If not, reactivate your plugins one by one and try again after each one.
    – Pat J
    Commented Jun 17, 2013 at 2:23
  • I do not have any plugins activated. Also this is a 100% custom theme that I have created. Any other ideas?
    – Reaction21
    Commented Jun 17, 2013 at 2:28
  • 1
    check your browser's error console for javascript errors. are you enqueueing any javascript files in your theme?
    – Milo
    Commented Jun 17, 2013 at 2:30

2 Answers 2


Make sure to define( 'WP_DEBUG', FALSE ); in wp-config.php. For some reason it doesn't allow you to add featured images from a custom post type with Debugging on.

  • 2
    If that is true, then something else must be wrong with your code. Commented Jul 7, 2014 at 20:11
  • I tried 3 themes 3 custom types using 3 tutorials all did the same...when I turned debug off all 3 worked. Really odd.
    – DLaverick
    Commented Aug 12, 2014 at 13:52

I found the answer. I was using a function to set the thumbnail sizes incorrectly. After I changed that function to the correct format it suddenly started working again.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.