Displays the post pages link navigation for previous and next pages.
Parameters
$sep
stringoptional- Separator for posts navigation links.
Default:
''
$prelabel
stringoptional- Label for previous pages.
Default:
''
$nxtlabel
stringoptional- Optional Label for next pages.
Default:
''
Source
function posts_nav_link( $sep = '', $prelabel = '', $nxtlabel = '' ) {
$args = array_filter( compact( 'sep', 'prelabel', 'nxtlabel' ) );
echo get_posts_nav_link( $args );
}
Changelog
Version | Description |
---|---|
0.71 | Introduced. |
Using Images
Default Usage
By default, the posts_nav_link() look like this:
« Previous Page — Next Page »
In Centered DIV
Displays previous and next page links (“previous page · next page”) centered on the page.
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:
This is better code:
You can change the text in each of the links and in the text in between the links.
You can go back to the previous page or you can go forward to the next page.