posts_nav_link( string $sep = , string $prelabel = , string $nxtlabel =  )

Displays the post pages link navigation for previous and next pages.


Separator for posts navigation links.


Label for previous pages.


Optional Label for next pages.


More Information

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

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

Note: since weblog posts are traditionally listed in reverse chronological order (with most recent posts at the top), there is some ambiguity in the definition of “next page”. WordPress defines “next page” as the “next page toward the past“.


function posts_nav_link( $sep = '', $prelabel = '', $nxtlabel = '' ) {
	$args = array_filter( compact( 'sep', 'prelabel', 'nxtlabel' ) );
	echo get_posts_nav_link( $args );



User Contributed Notes

  1. Skip to note 9 content

    Kubrick Theme Format

    The Kubrick theme format for posts navigation, could be formatted this way. However, using posts_nav_link() in this way will result in unintended behavior, such as double stacked next and previous links that link to the incorrect sections.

    The Kubrick Theme actually uses next_posts_link() and previous_posts_link() .

    This is poor code and should not be used:

    <div class="navigation">
    <div class="alignleft"><?php posts_nav_link( '', '', '&laquo; Previous Entries' ); ?></div>
    <div class="alignright"><?php posts_nav_link( '', 'Next Entries &raquo;', '' ); ?></div>

    This is better code:

    <div class="navigation">
    <div class="alignleft"><?php previous_posts_link( '&laquo; Previous Entries' ); ?></div>
    <div class="alignright"><?php next_posts_link( 'Next Entries &raquo;', '' ); ?></div>

You must log in before being able to contribute a note or feedback.