Support » Fixing WordPress » Next & Previous Post Titles With Thumbnails

  • Here is the code to grab the next post title & the thumbnail:

    <?php prev_post_link('%link&nbsp;&raquo;','%title', TRUE); ?><br /><?php $prevPost = get_prev_post(true); $prevthumbnail = get_the_post_thumbnail($prevPost->ID, array(150,150) ); echo $prevthumbnail; ?>
                        <span class="prev"><?php previous_post('&lsaquo; %', '', 'yes', 'no'); ?></span>
                        <?php next_post_link('&laquo;&nbsp;%link','%title', TRUE); ?><br /><?php $nextPost = get_next_post(true); $nextthumbnail = get_the_post_thumbnail($nextPost->ID, array(85,85) ); echo $nextthumbnail;?>
                        <span class="next"><?php next_post('% &rsaquo;', '', 'yes', 'no'); ?></span>

    How can I make it check if the $nextPost is filled and if not just put a blank image?


Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Next & Previous Post Titles With Thumbnails’ is closed to new replies.