Next and Previous functionality with thumbnail image in single post wordpress

paste the single.php <?php $prevPost = get_previous_post(); $prevthumbnail = get_the_post_thumbnail($prevPost->ID,array(80,97)); ?> <h2><?php previous_post_link('%link', 'Previous'); ?></h2> <?php previous_post_link('%link', $prevthumbnail); ?> <?php // Display the thumbnail of the next post ?> <?php $nextPost = get_next_post(); $nextthumbnail = get_the_post_thumbnail($nextPost->ID,array(80,97)); ?> <h2><?php next_post_link('%link', 'Next'); ?></h2> <?php next_post_link('%link', $nextthumbnail); ?> Thankyou All Rao Mahender Singh

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.