Summery Summery

Retrieves the navigation to next/previous post, when applicable.

Syntax Syntax

get_the_post_navigation( array $args = array() )

Parameters Parameters


(array) (Optional) Default post navigation arguments.

  • 'prev_text'
    (string) Anchor text to display in the previous post link. Default '%title'.
  • 'next_text'
    (string) Anchor text to display in the next post link. Default '%title'.
  • 'in_same_term'
    (bool) Whether link should be in a same taxonomy term. Default false.
  • 'excluded_terms'
    (array|string) Array or comma-separated list of excluded term IDs.
  • 'taxonomy'
    (string) Taxonomy, if $in_same_term is true. Default 'category'.
  • 'screen_reader_text'
    (string) Screen reader text for the nav element. Default 'Post navigation'.
  • 'aria_label'
    (string) ARIA label text for the nav element. Default 'Posts'.

Default value: array()

Return Return

(string) Markup for post links.

Source Source

File: wp-includes/link-template.php



Changelog Changelog

Version Description
5.3.0 Added the aria_label parameter.
4.4.0 Introduced the in_same_term, excluded_terms, and taxonomy arguments.
4.1.0 Introduced.


Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.