Thursday , 31 July 2014
Home | Articles | Wordpress | Only Show Featured Image on the First Page of a Post
Only Show Featured Image on the First Page of a Post

Only Show Featured Image on the First Page of a Post

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 Joe DiFiglia

I have always had a passion for everything computing. In early 2000, I decided to take my passion to the web. Thus, C.O.D. was born. Through the years we have made many great friends at C.O.D. and hope to continue our journey for years to come.