Customize Next and Previous Links in WordPress

Prem Tiwari - - WordPress, WordPress Beginners

Hello friends, hope you are doing good. The Next and Previous post links guide your website’s visitors through your WordPress site and it also helps you to get the more page views which boosts your SEO score. In this tutorial, I will explain how to customize Next and Previous Links in WordPress.

At the end of post and Page detail page, Next and Previous links appear to view the oldest and newest Post/page on your WordPress site. If you want to customize that links as per your site theme designs, then keep your close attention in this as I am going to share the simple & easy WordPress snippets to customize with many options.

Customize Next and Previous Links in WordPress

By default, the links will posts_nav_link looks like this:

Next and Previous Links « WordPress Codex

Want to change the text Previous Post & Next Post to something else, then use the below code:

You can add the directly previous and next post link:

Here is another way to customize the Next and Previous link by creating a new function inside the functions.php file. Use the below code in your theme’s functions.php file.

Open the template file and call the getPrevNext() function wher you want to add Next and Previous link.

About: Prem Tiwari

Prem Tiwari is the founder of and also a professional developer who has vast experience in PHP and open source technologies. Apart from this, he is a blogger by hobby and also he has been a regular speaker of WordPress sessions in various IT Companies.

Tags: , , , , , ,