wpseek.com
Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren



next_post › WordPress Function

Seit0.71
Veraltet2.0.0
next_post ( $format = '%', $next = 'next post: ', $title = 'yes', $in_same_cat = 'no', $limitnext = 1, $excluded_categories = '' )
Parameter: (6)
  • (string) $format
    Erforderlich: Nein
    Standard: '%'
  • (string) $next
    Erforderlich: Nein
    Standard: 'next post: '
  • (string) $title
    Erforderlich: Nein
    Standard: 'yes'
  • (string) $in_same_cat
    Erforderlich: Nein
    Standard: 'no'
  • (int) $limitnext
    Erforderlich: Nein
    Standard: 1
  • (string) $excluded_categories
    Erforderlich: Nein
    Standard: (leer)
Siehe:
Definiert in:
Codex:

Prints link to the next post.



Quellcode

function next_post($format='%', $next='next post: ', $title='yes', $in_same_cat='no', $limitnext=1, $excluded_categories='') {
	_deprecated_function( __FUNCTION__, '2.0.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;
}