LIVE Monday, November 23, 2026 DOW ▲ +0.42% S&P 500 ▲ +0.65% NASDAQ ▲ +0.81%
BBBBFNEWS
BBBBF News – Breaking World, U.S. & Business Headlines
Real-time international reporting, market trends, technological breakthroughs, and in-depth global perspectives.
ALERT
WEBSITE TUTORIAL

WordPress next post / previous post on the same category

WordPress next post / previous post on the same category

<?php
$current_category=get_the_category();
$prev_post = get_previous_post($current_category,”);
$next_post = get_next_post($current_category,”);
?>
<div class=”previous_post_link fl”>
<?php if (!empty( $prev_post )): ?>
<a href=”<?php%20echo%20get_permalink(%20$prev_post->ID%20);%20?>”><?php echo get_the_post_thumbnail( $prev_post->ID, ”, ” ); ?></a>
Pre: <a href=”<?php%20echo%20get_permalink(%20$prev_post->ID%20);%20?>”><?php echo $prev_post->post_title; ?></a>
<?php endif; ?>
</div>
<div class=”next_post_link fr”>
<?php if (!empty( $next_post )): ?>
<a href=”<?php%20echo%20get_permalink(%20$next_post->ID%20);%20?>”><?php echo get_the_post_thumbnail( $next_post->ID, ”, ” ); ?></a>
Next: <a href=”<?php%20echo%20get_permalink(%20$next_post->ID%20);%20?>”><?php echo $next_post->post_title; ?></a>
<?php endif; ?>
</div>