• I just upgraded to WordPress 5.7 and I don’t see the option to add a post thumbnail any more.

    I checked my functions.php and everything is still fine:

    add_theme_support( ‘post-thumbnails’ );

    I have tried all kind of stuff, but nothing that solves the problem, where it used to work perfectly before the upgrade.

    I also tried:

    function theme_setup(){
    /** post thumbnail **/
    add_theme_support( ‘post-thumbnails’ );
    }
    add_action(‘after_setup_theme’,’theme_setup’);

    Any ideas?

    • This topic was modified 3 years, 8 months ago by visualsense.
Viewing 15 replies - 1 through 15 (of 33 total)
  • Which editor are you using?
    Did you look for any option in the editor to control the showing of the Featured Image section?

    Thread Starter visualsense

    (@visualsense)

    This has nothing to do with the editor as far as I know. Like I said it worked until this update; this is what WP recommends doing and has always worked. I have checked everywhere and can’t find an option to enable/ disable it.

    The editor is the code that checks the theme support to determine whether to show the Featured Image section or not. Both editors have ways to enable/disable sections.
    It is working on my test site, with WP 5.7.
    Here is the Preferences modal for the block editor:

    Here is the Classic editor with the Screen Options open:

    Thread Starter visualsense

    (@visualsense)

    Thanks, I have the first editor.

    Here are my options:

    Document settings
    Yoast SEO
    Permalink
    Categories
    Tags
    Excerpt
    Discussion

    Additional
    Custom fields
    Select Associated Tip
    Yoast SEO

    As you can see, it completely ignores the theme support for thumbnail. So it must be something that conflicts. I already tried disabling/ enabling the ACF Pro plugin, but that wasn’t it. Will try to disable all plugins one by one, see if that helps.

    Thread Starter visualsense

    (@visualsense)

    I just figured out that it might had something to do with javascript, and it looks like it:

    WARNING
    wp.data.select( 'core/editor' ).getBlocks is deprecated. Please use wp.data.select( 'core/block-editor' ).getBlocks instead.
    c @ deprecated.min.js?ver=be1d4376501c21d85ba98dd28ca2d7ea:2

    ERROR
    Uncaught (in promise) TypeError: Cannot read property ‘theme_supports’ of undefined
    at core-data.min.js?ver=cae70cc4927f8b371fa13262d47b23e0:2
    at tryCatch (wp-polyfill.min.js?ver=7.4.4:1)
    at Generator.invoke [as _invoke] (wp-polyfill.min.js?ver=7.4.4:1)
    at Generator.t.<computed> [as next] (wp-polyfill.min.js?ver=7.4.4:1)
    at redux-routine.min.js?ver=284288e957394d2097c6fbe95625e2fb:2

    I think something went wrong with the update, so I will manually replace some core folders to see if that’s it.

    Thread Starter visualsense

    (@visualsense)

    A new WordPress installation did not fix it either…

    That does look like the editor can’t get the ‘theme_supports’ value. But why would it work for me?
    Perhaps you have some Javascript that has an error, so it affects core scripts.
    You can try the Health Check plugin in Troubleshoot mode, which will disable plugins and theme for your user only, so you can isolate if the problem is in added code or in core.
    Or you can try the Enable jQuery Migrate Helper plugin, to see if it tells you there are deprecated calls to old jQuery that would mess up other scripts. jQuery has changed in the last few WP releases.

    I am getting the same error:
    Uncaught (in promise) TypeError: Cannot read property ‘theme_supports’ of undefined

    at core-data.min.js?ver=cae70cc4927f8b371fa13262d47b23e0:2
    at tryCatch (wp-polyfill.min.js?ver=7.4.4:1)
    at Generator.invoke [as _invoke] (wp-polyfill.min.js?ver=7.4.4:1)
    at Generator.t.<computed> [as next] (wp-polyfill.min.js?ver=7.4.4:1)
    at redux-routine.min.js?ver=284288e957394d2097c6fbe95625e2fb:2

    Seems like it is wordpress core files. But if replacing them doesnt fix it, what is the cause?

    This is with the migrate code ON. (JQMIGRATE: Migrate is installed, version 3.3.2)

    I think I may have to play around with some things. I will report back if I discover anything.

    • This reply was modified 3 years, 8 months ago by filmmaker3000.

    I just tried the health check plugin joy recommended, and turned on troubleshooting mode. The Featured Image was there. So there must be some sort of plugin that is breaking it. Not sure which one though.

    Edit: Another update, I went through and found out it was something to do with my theme, not any plugins. Health check is awesome, thanks Joy! I went in, disabled everything, and then manually enabled all plugins and tried themes.

    I’m still not sure what exactly… I only know my theme is doing something weird.

    Thread Starter visualsense

    (@visualsense)

    I have tried both plugins and getting some results. It works with the default theme, but with my own theme (all plugins disabled) I am still getting the following error:

    Uncaught (in promise) TypeError: Cannot read property ‘theme_supports’ of undefined
    at core-data.min.js?ver=cae70cc4927f8b371fa13262d47b23e0:2
    at tryCatch (wp-polyfill.min.js?ver=7.4.4:1)
    at Generator.invoke [as _invoke] (wp-polyfill.min.js?ver=7.4.4:1)
    at Generator.t.<computed> [as next] (wp-polyfill.min.js?ver=7.4.4:1)
    at redux-routine.min.js?ver=284288e957394d2097c6fbe95625e2fb:2

    Will dig some more…

    Thread Starter visualsense

    (@visualsense)

    Ok, it looks like an older version of jquery-ui was causing the trouble. I have updated it and I am finally seeing the thumbnail option again.

    Thanks for your reply! I upgraded my jquery UI to 1.12.1 and it didn’t work. But I did get a new message in the console:

    wp.data.select( ‘core/editor’ ).getBlocksis deprecated. Please usewp.data.select( ‘core/block-editor’ ).getBlocks` instead.

    I searched and there are some core/editor in my wp-includes folder in some files, but they were updated on the 9th when I upgraded to 5.7, so I’m not sure what to do.

    Edit: I am wondering if it might have to do with Advanced Custom Fields.

    • This reply was modified 3 years, 8 months ago by filmmaker3000.

    So using the Health Checker, I found that Yoast is causing that wp.data.select( 'core/editor' ).getBlocks is deprecated. Please use wp.data.select( 'core/block-editor' ).getBlocks instead. But that doesnt cause the removing the featured image.

    Please report any problems you find to the individual plugin or theme support forum, so all their users get the fix.

    Hello, I got the same error when updating to WordPress 5.7, the solution to my problem was that my theme did not have the index.php file, you just have to create it empty and that’s it. Well at least it worked for me.

Viewing 15 replies - 1 through 15 (of 33 total)
  • The topic ‘Theme support for post-thumbnails stopped working after upgrading to WP 5.7’ is closed to new replies.