WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
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 Jun 17 '13 at 2:10
I have checked that already. If I go to Media > Add New Media I can upload files just fine. – Reaction21 Jun 17 '13 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 Jun 17 '13 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 Jun 17 '13 at 2:28
check your browser's error console for javascript errors. are you enqueueing any javascript files in your theme? – Milo Jun 17 '13 at 2:30

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.

share|improve this answer
If that is true, then something else must be wrong with your code. – ialocin Jul 7 '14 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 Aug 12 '14 at 13:52
up vote 0 down vote accepted

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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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