-
-
Save eyecandy91/062f009759f0fee12e681a3b4ff1c33e to your computer and use it in GitHub Desktop.
php get title and thumbnail inside next and prev btns
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="cooler-nav" class="navigation"> | |
<?php $prevPost = get_previous_post(true); | |
if($prevPost) {?> | |
<div class="nav-box previous" style="float:left;"> | |
<?php $prevthumbnail = get_the_post_thumbnail($prevPost->ID, array(100,100) );}?> | |
<?php previous_post_link('%link',"$prevthumbnail %title", TRUE); ?> | |
</div> | |
<?php $nextPost = get_next_post(true); | |
if($nextPost) { ?> | |
<div class="nav-box next" style="float:right;"> | |
<?php $nextthumbnail = get_the_post_thumbnail($nextPost->ID, array(100,100) ); } ?> | |
<?php next_post_link('%link',"$nextthumbnail %title", TRUE); ?> | |
</div> | |
</div><!--#cooler-nav div --> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment