WordPress.org

Ready to get started?Download WordPress

Forums

Post Thumbnails or Featured Images doesn't show on my main home page (2 posts)

  1. cyrilnicko
    Member
    Posted 6 months ago #

    Post Thumbnails or Featured Images doesn't show on my main home page. But images appear on the other pages. Whenever I switch to another theme, especially "twentytwelve" theme, the featured image shows on home page.

    I placed the code <?php the_post_thumbnail(); ?> in header.php. What will I do? I am new to WordPress. Thanks.

  2. xavortm
    Member
    Posted 6 months ago #

    the_post_thumbnail() must be used inside the loop. First of all, not in the header.php file. Check the code of twentytwelve to see how its done.

    https://codex.wordpress.org/Function_Reference/the_post_thumbnail
    See in the link above how its used INSIDE the loop.

Reply

You must log in to post.

About this Topic