next_post_link

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

Display next 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 next_post_link($format='%link »', $link='%title', $in_same_cat = false, $excluded_categories = '') {

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

}

2449

next_posts_link

Definition:
function next_posts_link( $label = null, $max_page = 0 ) {}

Display the next posts page link.

Parameters

  • string $label: Content for link text.
  • int $max_page: Optional. Max pages.

Source code

function next_posts_link( $label = null, $max_page = 0 ) {

	echo get_next_posts_link( $label, $max_page );

}

2447

next_posts

Definition:
function next_posts( $max_page = 0, $echo = true ) {}

Display or return the next posts page link.

Parameters

  • int $max_page: Optional. Max pages.
  • boolean $echo: Optional. Echo or return;

Source code

function next_posts( $max_page = 0, $echo = true ) {

	$output = esc_url( get_next_posts_page_link( $max_page ) );



	if ( $echo )

		echo $output;

	else

		return $output;

}

2445

next_post

Definition:
function next_post($format='%', $next='next post: ', $title='yes', $in_same_cat='no', $limitnext=1, $excluded_categories='') {}

Prints link to the next post.

Parameters

  • string $format
  • string $next
  • string $title
  • string $in_same_cat
  • int $limitnext
  • string $excluded_categories

Defined filters

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

Source code

function next_post($format='%', $next='next post: ', $title='yes', $in_same_cat='no', $limitnext=1, $excluded_categories='') {

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



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

		$in_same_cat = false;

	else

		$in_same_cat = true;



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



	if ( !$post	)

		return;



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

	if ( 'yes' == $title )

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

	$string .= '</a>';

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

	echo $format;

}

2443

next_image_link

Definition:
function next_image_link($size = 'thumbnail', $text = false) {}

Display next image link that has the same post parent.

Parameters

  • string $size: Optional, default is ‘thumbnail’. Size of image, either array or string. 0 or ‘none’ will default to post_title or $text;
  • string $text: Optional, default is false. If included, link will reflect $text variable.

Return values

returns:HTML content.

Source code

function next_image_link($size = 'thumbnail', $text = false) {

	adjacent_image_link(false, $size, $text);

}

2441