Internet Resource

Display the Featured Image Only on the First Page

Remove the featured image from the rest of the next page which post using the code <!–NextPage–>

 

<!--NextPage-->

I have 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.

Here is the solution:

Add the following code to replace your featured image code:

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