Next Previous Post Thumbnails loading Wrong Post Images
-
I believe I used this successfully in one of my other sites, but on the specific site I’m building now, the code below (from my single.php) is either loading the wrong thumbnails, or no thumbnails whatsoever. Any ideas?
An example can be seen at https://pinmystyle.com/w/womens-style/cute-black-and-yellow-outfit-black-boots/ at the bottom of the page, you can click to one of the next pages and see that the wrong thumbnails load.
<?php $prevPost = get_previous_post(true); $prevthumbnail = get_the_post_thumbnail($prevPost->ID, array(100,100) ); ?> <?php $nextPost = get_next_post(true); $nextthumbnail = get_the_post_thumbnail($nextPost->ID, array(100,100) ); ?> <div id="nav-below" class="navigation"> <div class="nav-previous"> <span class="navprevpic"><?php previous_post_link('%link',"$prevthumbnail", true); ?></span> <span class="navprevlink"><?php previous_post_link('%link', '<span class="meta-nav">?</span> %title') ?></span> </div> <div class="nav-next"> <span class="navnextlink"><?php next_post_link('%link', '%title <span class="meta-nav">?</span>') ?></span> <span class="navnextpic"><?php next_post_link('%link',"$nextthumbnail", true); ?></span> </div> </div>
Viewing 9 replies - 1 through 9 (of 9 total)
Viewing 9 replies - 1 through 9 (of 9 total)
- The topic ‘Next Previous Post Thumbnails loading Wrong Post Images’ is closed to new replies.