adjacent_posts_rel_link

Displays the relational links for the posts adjacent to the current post.

Description

adjacent_posts_rel_link( , (constant) $in_same_term = false, (string) $excluded_terms = '', (string) $taxonomy = 'category' ); 

Parameters (4)

0. $title — Optional. (string) => '%title'
Link title format.
1. $in_same_term — Optional. (constant) => false
Whether link should be in a same taxonomy term.
2. $excluded_terms — Optional. (string) => ''
Array or comma-separated list of excluded term IDs.
3. $taxonomy — Optional. (string) => 'category'
Taxonomy, if $in_same_term is true. Default category..

Usage

  1. if ( !function_exists( 'adjacent_posts_rel_link' ) ) { 
  2. require_once ABSPATH . WPINC . '/link-template.php'; 
  3.  
  4. // Optional. Link title format. 
  5. $title = '%title'; 
  6.  
  7. // Optional. Whether link should be in a same taxonomy term. 
  8. $in_same_term = false; 
  9.  
  10. // Optional. Array or comma-separated list of excluded term IDs. 
  11. $excluded_terms = ''; 
  12.  
  13. // Optional. Taxonomy, if $in_same_term is true. Default 'category'. 
  14. $taxonomy = 'category'; 
  15.  
  16. // NOTICE! Understand what this does before running. 
  17. $result = adjacent_posts_rel_link($title, $in_same_term, $excluded_terms, $taxonomy); 
  18.  

Defined (1)

The function is defined in the following location(s).

/wp-includes/link-template.php  
  1. function adjacent_posts_rel_link( $title = '%title', $in_same_term = false, $excluded_terms = '', $taxonomy = 'category' ) { 
  2. echo get_adjacent_post_rel_link( $title, $in_same_term, $excluded_terms, true, $taxonomy ); 
  3. echo get_adjacent_post_rel_link( $title, $in_same_term, $excluded_terms, false, $taxonomy );