Summery Summery

Retrieves the adjacent post link.

Syntax Syntax

get_adjacent_post_link( string $format, string $link, bool $in_same_term = false, array|string $excluded_terms = '', bool $previous = true, string $taxonomy = 'category' )

Description Description

Can be either next post link or previous.

Parameters Parameters


(string) (Required) Link anchor format.


(string) (Required) Link permalink format.


(bool) (Optional) Whether link should be in a same taxonomy term.

Default value: false


(array|string) (Optional) Array or comma-separated list of excluded terms IDs.

Default value: ''


(bool) (Optional) Whether to display link to previous or next post.

Default value: true


(string) (Optional) Taxonomy, if $in_same_term is true.

Default value: 'category'

Return Return

(string) The link URL of the previous or next post in relation to the current post.

Source Source

File: wp-includes/link-template.php



Changelog Changelog

Version Description
3.7.0 Introduced.


Leave a Reply

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