Using WordPress as a content management system brings you tons of flexibility. Unfortunately, most of the flexibility is unrealized unless you start diving into some code. For me, there are certain times when coding is the only way to get things done. Recently, I ran into a situation where a site I was working on wanted to hide something until the reader reached the last page of a post. By default, there is no way to do this in WordPress. Don’t fret, accomplishing this is as easy.
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.
Let’s say for instance you wanted to hide the Post Featured Image until the last page of your post. You would look for this:
[php]</pre><div><!–?<span class="hiddenSpellError" pre="">php</span> the_post_thumbnail(); –></div>
<pre>
[/php]
and change it to this
[php]<!–?php if( $page == $<span class="hiddenSpellError" pre="page "–>numpages ) {<div><!–?php the_post_thumbnail(); –></div>
} ?>[/php]