admin管理员组

文章数量:1122846

I have a custom theme. I've deactivated every plugin. I can't get the Featured Image block on the right sidebar of editing a post to show up so that the user can set the featured image.

I have this in my functions.php file:

add_theme_support( 'post-thumbnails' );

Note that this worked fine before Wordpress 5 / Gutenberg update.

What am I missing?

I have a custom theme. I've deactivated every plugin. I can't get the Featured Image block on the right sidebar of editing a post to show up so that the user can set the featured image.

I have this in my functions.php file:

add_theme_support( 'post-thumbnails' );

Note that this worked fine before Wordpress 5 / Gutenberg update.

What am I missing?

Share Improve this question asked May 6, 2019 at 13:47 RailsTweeterRailsTweeter 2631 gold badge4 silver badges11 bronze badges 1
  • Note that when I use the Classic Editor, it also doesn't work. Same issue. – RailsTweeter Commented May 6, 2019 at 13:56
Add a comment  | 

3 Answers 3

Reset to default 5

The function with the add_theme_support( 'post-thumbnails' ); wasn't being called for some reason. Once I fixed that, everything works now.

I'm facing the same issue. I also can't see the thumbnail meta box in Gutenberg editor.

I tried different ways but unfortunately, still, the same issue exists.

In the below code, you can see I enable the post-thumbnails for post and page.

add_theme_support('post-thumbnails', array('post', 'page'));

When I found the above code was not working then I tried the below code

add_action('after_setup_theme', function () {
    remove_theme_support('post-thumbnails');
    add_theme_support('post-thumbnails', array('post', 'page', 'hero', 'event', 'video'));
});

But still, the same issue exists.

Note: If I disable the Gutenberg editor by using this code then I can see the thumbnail image meta box

add_filter('use_block_editor_for_post', '__return_false', 10);

Waiting for your help!

Thanks!

My issue was solved by Deactivating and then reactivating the theme. NOTE: I had all the relevant code already there with no issues (in terms of code) and i was still not able to get that Featured Image Metabox.

本文标签: Wordpress 5Gutenbergtheme doesn39t have featured image option showing up