Skip to main content
WordPress made easy with the drag & drop Total WordPress Theme!Learn More

Show “Last Post” and “Next Post” Links On Single WordPress Posts

Last updated on:

Earlier today a buddy  of mine from Publishers Vault was asking me how to change his next and previous post links on his posts from the title of the post to a custom text such as “Previous Article and “Next Article”. I think most themes out there show the title for prev/next posts for SEO reasons but sometimes when titles get too long it can look pretty bad.

Below is a small code snippet that you can paste anywhere on your single.php files to show links to the post before and the post after the current post.

Next & Last Post Links Code With Custom Text

<?php
//last post
previous_post_link('%link', 'Last Post', TRUE); ?>
<?php
//next post
next_post_link('%link', 'Next Post', TRUE); ?>


Subscribe to the Newsletter

Get our latest news, tutorials, guides, tips & deals delivered to your inbox.

Comments

No comments yet. Why don't you kick off the discussion?

Leave a Reply

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

Learn how your comment data is processed by viewing our privacy policy here.