Display adjacent post link.

Can be either next post link or previous.

Signature

adjacent_post_link( $format, $link, $in_same_cat = false, $excluded_terms = '', $previous = true, $taxonomy = 'category' )
format
 (string) Link anchor format.
link
 (string) Link permalink format.
in_same_cat
 (boolean) Optional. Whether link should be in a same category.
Default: false
excluded_terms
 (array|string) Optional. Array or comma-separated list of excluded category IDs.
Default: ''
previous
 (boolean) Optional. Whether to display link to previous or next post. Default true.
Default: true
taxonomy
 (string) Optional. Taxonomy, if $in_same_term is true. Default 'category'.
Default: 'category'

Return

(string)

Source

function adjacent_post_link( $format, $link, $in_same_cat = false, $excluded_terms = '', $previous = true, $taxonomy = 'category' ) {
	echo get_adjacent_post_link( $format, $link, $in_same_cat, $excluded_terms, $previous, $taxonomy );
}
WP Trac GitHub

Link here