get_the_post_navigation
get_the_post_navigation ( $args = array() )
Parameters:- (array) args {
Optional. Default post navigation arguments. Default empty array.
@type string $prev_text Anchor text to display in the previous post link.
Default '%title'.
@type string $next_text Anchor text to display in the next post link.
Default '%title'.
@type bool $in_same_term Whether link should be in the same taxonomy term.
Default false.
@type int[]|string $excluded_terms Array or comma-separated list of excluded term IDs.
Default empty.
@type string $taxonomy Taxonomy, if `$in_same_term` is true. Default 'category'.
@type string $screen_reader_text Screen reader text for the nav element.
Default 'Post navigation'.
@type string $aria_label ARIA label text for the nav element. Default 'Posts'.
@type string $class Custom class for the nav element. Default 'post-navigation'.
}
Returns:- (string) Markup for post links.
Defined at:Change Log: - Introduced in WordPress: 4.1.0
- Deprecated in WordPress: —
Description
Retrieves the navigation to next/previous post, when applicable.