I want to show next previous button in single.php please suggest me the possible way, I'm stuck at these point in my site development



> <?php posts_nav_link(); ?> <?php
> posts_nav_link('separator','prelabel','nextlabel'); ?> <?php echo
> get_next_posts_link(); ?> 
> Default Usage
> <?php echo get_next_posts_link(); ?>

just want to add links in these buttons please suggest me the best way and links need to add in the loop.

I have tried basic functions but can't get output as i want

  • 1
    "I have tried basic functions but can't get output as i want" What have you tried and what was wrong with them. If you don't include that information you're just going to waste people's time suggesting things you've already tried. May 28, 2018 at 11:31
  • Sorry for that, I have updated now
    – Mehul
    May 28, 2018 at 11:40

1 Answer 1


Looks like you are trying to get a link to next/previous pagination results on a single(single.php) view which it doesn't make sense to me. Please refer to the docs: https://codex.wordpress.org/Function_Reference/posts_nav_link

For archive view:

For displaying next and previous pages of posts see next_posts_link() and previous_posts_link().

For single view:

For displaying next and previous post navigation on individual posts, see next_post_link() and previous_post_link().

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.