How can I get "Previous" and "Next" to show in the navigation besides the links?

I have been editing PHP templates in wordpress for the website. In their resources tab, which is the blog, the navigation currently says ‘Posted’, ‘Tagged in’ and then the links underneath the bottom of the page. I found the navigation in the template-tags.php and was able to edit the first two to say ‘Posted:’ and ‘Tagged:’, but the links need to have Previous and Next appear before them. Plus I also want to add a break between the post navigation and the links after Previous and Next.

The biggest problem I have is with the %link and %title when working on getting the ‘previous’ and ‘next’ to show up. Plus the pagination is set to the_post_navigation() and when I try to do the_posts_navigation(), the links do not show up at the bottom of the page.

PHP with posts_navgation():

<?php if ( get_next_posts_link() ) : ?>
<div class="nav-previous"><span class="tags-links">Previous: </span><?php next_posts_link( esc_html__( 'Older posts', 'thermal-tech' ) ); ?></div>
<?php endif; ?>

<?php if ( get_previous_posts_link() ) : ?>
<div class="nav-next">span class="tags-links">Next: </span><?php previous_posts_link( esc_html__( 'Newer posts', 'thermal-tech' ) ); ?></div>
<?php endif; ?>

PHP with post_navigation():

previous_post_link( '<div class="nav-previous"><span class="tags-links">Previous: </span>%link</div>', '%title' );
next_post_link( '<div class="nav-next"><span class="tags-links">Next: </span>%link</div>', '%title' );

Read more here: How can I get "Previous" and "Next" to show in the navigation besides the links?

Leave a Reply

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