• Resolved taghaboy

    (@taghaboy)


    Hi;
    I have this code in the header.php as a “Banner”

    <?php
    if ( has_post_thumbnail() ) {
    	the_post_thumbnail('full');
    }
    else {
    	echo '<div id="default-banner-header"></div>';
    }
    ?>

    And I’d like to know how to display the “post thumbnail” only in “Pages” and note in “posts”?

    Thanks you.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Jamie

    (@codente)

    You would need to add a conditional to check if a page is displaying

    e.g.

    <?php
    if ( is_page() && has_post_thumbnail() ) {
    	the_post_thumbnail('full');
    }
    else {
    	echo '<div id="default-banner-header"></div>';
    }
    ?>
    Thread Starter taghaboy

    (@taghaboy)

    Your angel lady Codente, it work like a charm.
    Thanks a lot

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘how to display the "post thumbnail" only in "Pages" and note in "posts&quot’ is closed to new replies.