WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Add theme support feature not working (4 posts)

  1. prionkor
    Member
    Posted 3 years ago #

    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?

  2. Mark / t31os
    Moderator
    Posted 3 years ago #

    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).
  3. prionkor
    Member
    Posted 3 years ago #

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

  4. Mark / t31os
    Moderator
    Posted 3 years ago #

    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.. :)

Topic Closed

This topic has been closed to new replies.

About this Topic