prev_post_rel_link

Definition:
function prev_post_rel_link($title = '%title', $in_same_cat = false, $excluded_categories = '') {}

Display relational link for the previous post adjacent to the current post.

Parameters

  • string $title: Optional. Link title format.
  • bool $in_same_cat: Optional. Whether link should be in a same category.
  • array|string $excluded_categories: Optional. Array or comma-separated list of excluded category IDs.

Source code

function prev_post_rel_link($title = '%title', $in_same_cat = false, $excluded_categories = '') {

	echo get_adjacent_post_rel_link($title, $in_same_cat, $excluded_categories = '', true);

}

2619

previous_post_link

Definition:
function previous_post_link($format='« %link', $link='%title', $in_same_cat = false, $excluded_categories = '') {}

Display previous post link that is adjacent to the current post.

Parameters

  • string $format: Optional. Link anchor format.
  • string $link: Optional. Link permalink format.
  • bool $in_same_cat: Optional. Whether link should be in a same category.
  • array|string $excluded_categories: Optional. Array or comma-separated list of excluded category IDs.

Source code

function previous_post_link($format='« %link', $link='%title', $in_same_cat = false, $excluded_categories = '') {

	adjacent_post_link($format, $link, $in_same_cat, $excluded_categories, true);

}

2617

previous_posts_link

Definition:
function previous_posts_link( $label = null ) {}

Display the previous posts page link.

Parameters

  • string $label: Optional. Previous page link text.

Source code

function previous_posts_link( $label = null ) {

	echo get_previous_posts_link( $label );

}

2615

previous_posts

Definition:
function previous_posts( $echo = true ) {}

Display or return the previous posts page link.

Parameters

  • boolean $echo: Optional. Echo or return;

Source code

function previous_posts( $echo = true ) {

	$output = esc_url( get_previous_posts_page_link() );



	if ( $echo )

		echo $output;

	else

		return $output;

}

2613

previous_post

Definition:
function previous_post($format='%', $previous='previous post: ', $title='yes', $in_same_cat='no', $limitprev=1, $excluded_categories='') {}

Prints link to the previous post.

Parameters

  • string $format
  • string $previous
  • string $title
  • string $in_same_cat
  • int $limitprev
  • string $excluded_categories

Defined filters

  • the_title
    apply_filters('the_title', $post->post_title, $post->ID)

Source code

function previous_post($format='%', $previous='previous post: ', $title='yes', $in_same_cat='no', $limitprev=1, $excluded_categories='') {



	_deprecated_function( __FUNCTION__, '2.0', 'previous_post_link()' );



	if ( empty($in_same_cat) || 'no' == $in_same_cat )

		$in_same_cat = false;

	else

		$in_same_cat = true;



	$post = get_previous_post($in_same_cat, $excluded_categories);



	if ( !$post )

		return;



	$string = '<a href="'.get_permalink($post->ID).'">'.$previous;

	if ( 'yes' == $title )

		$string .= apply_filters('the_title', $post->post_title, $post->ID);

	$string .= '</a>';

	$format = str_replace('%', $string, $format);

	echo $format;

}

2611