WordPress.org

Support

Support » How-To and Troubleshooting » [Resolved] Add theme support feature not working

[Resolved] Add theme support feature not working

  • Hi, i am here again 🙂

    I was trying to add theme support in my new wordpress theme. the support for post thumbnails is not working.

    i add the function add_theme_support(‘post-thumbnails’); in functions.php file. So the feature should add for both post and the page as per as the wordpress codex.

    The featured image panel is showing in both page and post admin page but while i call the thumbnail image form the theme it does not work.

    if(has_post_thumbnail()):
     the_post_thumbnail();
    endif;

    Can anyone let me know what i did wrong?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Are you certain the code is in the correct template file, if you echo a basic string or place some basic HTML into the template is it then visible on this page?

    It would be my assumption the problem is either.

    1. You’re placing the code into the wrong theme file.
    2. The placement of the code in the theme file(correct file, wrong place).

    Thanks! Did a dumbest mistake. Put the code outside of the if(have_post…) It works now. Thanks!

    Sometimes the best of us get thrown off by the simplest of things, a second pair of eyes usually helps in those times… 🙂

    Happy i could help.. 🙂

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Resolved] Add theme support feature not working’ is closed to new replies.