Support » Fixing WordPress » display the featured image only in first page.

  • Resolved castofclowns27

    (@castofclowns27)


    Hi,

    I have a question about the featured image in the single page. In my site I split the posts into multiple pages using <!––nextpage––> in editor. Also I have a <?php the_post_thumbnail( ‘single-post-thumbnail’ ); ?> in my single.php file.

    What happen now is that the featured image will show to all multiple pages. All I want is that the featured image will only show in the first page.

    Please anyone…

Viewing 2 replies - 1 through 2 (of 2 total)
  • You just need to verify that it’s the first page before displaying the thumbnail. This should work in your page template:

    <?php
    global $page;
    if ($page == 1) {
      the_post_thumbnail( 'single-post-thumbnail' );
    } ?>
    Thread Starter castofclowns27

    (@castofclowns27)

    Thank you so much amduffy it works fine now. I really Appreciate it. 🙂

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘display the featured image only in first page.’ is closed to new replies.