Support » Developing with WordPress » Theme support for post-thumbnails stopped working after upgrading to WP 5.7

  • 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 2 years, 8 months ago by visualsense.
Viewing 15 replies - 16 through 30 (of 33 total)
  • Thanks omarbgno, but my theme has an index.php file. I wonder if there is something in the php file that is causing it.

    Hello

    I had the same error, and I confirm what omarbgno said :
    I had renamed index.php to front-page.php .. so I didn’t have any index.php and I had the error with the thumbnails…
    I kept my front-page but I added an index.php -> thumbnails were back to my post editing, and the error disappeared …

    that was the problem … no index.php … no post thumbnails

    Thanks Julien,

    Unfortunately, it is still not working for me. I have an index.php and I still do not see the featured image section. I tried renaming the index.php to front-page.php, and adding a separate index.php, but it still didn’t work.

    Hello, I’m having this same issue and tried all of the possible fixes in this thread, but to no avail.

    1. I do have an index.php file in the theme root directory
    2. Tried using front-page.php
    3. The jQuery UI version in WP admin is up-to-date
    4. I have exactly the same version/n on my local host, how I don’t get this issue

    Any help would be appreciated!

    Thanks

    I found the issue, in our case it was the child themes style.css ‘Template’ set incorrectly, the case (uppercase/lowercase) of the string was incorrect:

    E.g it was set to ‘Template: xxxx-parent’ were it needed to be ‘Template: XXXX-Parent’

    Hi Acornsdev,

    I looked through and I did not see anything weird like that on mine. For me, the site theme starts with numbers 1234 Website. After reading your post, I thought it could be the numbers, so I renamed it to The 1234 Website and that didn’t work. One thing to note, I have an older theme installed with the same name, and that one works fine. That old theme, for some reason, is getting the featured image option and does not have that theme_supports error from the original post.

    Still struggling to solve this one! Thanks for your post though!

    @filmmaker3000

    Yes sounds like it’s your theme, do you have a parent and child theme? just check these are setup correctly.

    Mine had the issue I mentioned, but it’s always been like this, only after updating to WP 5.7 did it affect the site. But my local version was fine and it’s an exact copy of the live site. So I think it’s a mixture on WP 5.7 update and server. May be mu local server is not so sensitive to upper/lower case. No idea but t was a very strange bug, to be fair the same as the other fixes in this thread.

    Thanks @acornsdev for the help. It is not a parent / child theme. Running locally breaks it as well.

    I did notice that when I go to themes, the theme that has this issue does not say “Activated” and then the customize button. It just has the Activate button. For some reason I cannot get the theme to show that it is activated. The theme works when I activate it, but in WordPress it doesn’t have the black highlight that shows it is activated in the Themes.

    I think this might be a clue. I’m still trying to figure it out. Thanks!

    @filmmaker3000 Yes this is what I had, if I changed the ‘stylesheet’ value in the wp_options table to the backup theme, this fixed the issue of the missing ‘featured image’ but the frontend had the wrong style.

    Just some more info for you, as I think your issue is very similar to mine!

    @acornsdev Yeah, if I change the stylesheet, the theme breaks. If I change the theme the featured image functionality works, which means something is definitely wrong with my theme. But I can’t figure out for the life of me what it is!

    Thanks for your help and advice!

    I opened a Trac ticket for this issue.
    https://core.trac.wordpress.org/ticket/52855

    @joyously Thank you!

    Hello!

    I had the same problem.
    But I fixed it by renaming the template folder.
    Old template name was “2019”.
    New template name is “mytemplate”.

    And now everything works fine

    @kumigy You DID IT!!!! That’s the answer! I can reproduce this. If the folder of the theme has ONLY numbers, it breaks the theme. If you add letters before OR after, this fixes the issue. THANK YOU SO MUCH!!!

    @joyously This issue has been solved. Can you try to reproduce it? If the theme folder is named 4 numbers (1234), it breaks it. If you add characters before or after (I added 1234_realtheme and the1234 and both worked. I will add a comment to your bug report.

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

    I had the same issue – no featured image showing with gutenberg.

    Creating an index.php in my storefront-child solved the issues.

    Wordpress 5.7

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