Only Show Featured Image on the First Page of a Post

1
Posted September 7, 2011 by Joe DiFiglia in Articles
wordpress-thumbnail-logo



The nice thing about running sites on WordPress is that you will never run out of things to try. It seems like there is always something new that can be done to better the experience of the reader or further enhance the site. Featured Images are a great way to show off your post, but what if you don’t want the featured image displayed on every page of your paginated post/page? Well, welcome to the solution center! There is an easy way to accomplish this.

In your theme, you may have a page.php or a single.php file depending on how your theme is set up.  If you don’t have a page.php, you need to edit your single.php file.

look for something like:

<div>
     <?php the_post_thumbnail(); >
</div>

and change it to:

<?php
   $paged = get_query_var( 'page' ) ? get_query_var( 'page' ) : false;
   if ( $paged === false ): ?>
   <div>
     <?php the_post_thumbnail(); ?>
   </div>
<?php endif; >

Note: This one is my own creation.


About the Author

Joe DiFiglia

In early 2000 I became increasingly frustrated with hardware review sites praising less than satisfactory products. The saying: “if you want something done right, do it yourself” applies here. I wasn’t satisfied, so I did it myself; and here we are years later.