Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

WordPress

Featured image metabox not appearing on custom post edit page

Previously, when I did the WordPress custom theme course, I enabled the featured image metabox to appear on the custom post edit screen simply by including add_theme_support('post-thumbnails') in my functions file. I'm going back through the lesson as I create another website, and the metabox is not appearing. I seem to be following the lesson to the letter. I've compared my code to that of my former site, and they both look identical. I'm pretty puzzled by this.

Btw, I have tried deactivating my plugins independently, and looking for changes after each one. I have also made sure that the featured image box is not hidden by leaving it unchecked on the custom fields UI page.

I have heard that I may need to register my custom post type in the functions page to support thumbnails. However, this confuses me, since I don't remember having had to do this during the WordPress lessons.

As always, any help is greatly appreciated. Just trying to better understand how WP works.

3 Answers

Omg, this took forever to ferret out! If anyone else is having the same problem, and you are using the the Adv Custom Fields and Custom Post Type UI plugins, then take note. In addition to adding theme support for thumbnails, AND unchecking the "hide item" box on the Custom Fields edit page, you MUST ALSO make sure that the specific options you want are checked under the Custom Post Type settings in the Manage Post Types section. It's a lot less confusing than it sounds.

Also, as Zack says in his tutorial, you can use the register support function in your functions file. However, all of your enabled items will disappear if you ever change out themes. Best to use the plugins.

Sean T. Unwin
Sean T. Unwin
28,690 Points

I was just going to post to check that 'Featured Image' was checked in Screen Options. Its so easily forgettable sometimes.

Glad you got it worked out! :)

Oh, yeah. That's another place to check. Lol.

Sean T. Unwin
Sean T. Unwin
28,690 Points

If you are using the Custom Fields plugin, then you need to make sure that 'Featured Image' is unchecked in the Options section of your custom field group or else the Featured Image' option will not show up in the new/ edit post page.

That's correct, Sean. The box is unchecked.

Sean T. Unwin
Sean T. Unwin
28,690 Points

And you are hooking add_theme_support into 'after_theme_setup'?

I typically create a function for theme support similar to the following;

function my_custom_theme_setup() {
    add_theme_support( 'menus' );
    add_theme_support( 'post-thumbnails' );
    // other options
}
add_action( 'after_setup_theme', 'my_custom_theme_setup' );

I gave it a try, but it didn't work. Thanks, though.

Adding theme support doesn't seem to be the issue. As I wrote initially, post-thumbnails are theme enabled exactly in this project as they were in my previous one. In the previous site, it works perfectly, per the treehouse course instructions. In the latter project, it doesn't. I'm just trying to figure out why.