Blog - Latest News

Check has post next and previous link

<?php $previous_post = get_adjacent_post(false, ”, true); $next_post = get_adjacent_post(false, ”, false); ?> <ul> <?php if ($previous_post): // if there are older articles ?> <li class=”prev”>Previous post: <a href=”<?php echo make_href_root_relative(get_permalink($previous_post)); ?>”><?php echo get_the_title($previous_post); ?></a></li> <?php endif; ?> <?php if ($next_post): // if there are newer articles ?> <li class=”next”>Next post: <a href=”<?php echo make_href_root_relative(get_permalink($next_post)); ?>”><?php […]

0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *