Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




next_post [ WordPress Function ]

next_post ( $format = '%', $next = 'next post: ', $title = 'yes', $in_same_cat = 'no', $limitnext = 1, $excluded_categories = '' )
Parameters:
  • (string) $format
  • (string) $next
  • (string) $title
  • (string) $in_same_cat
  • (int) $limitnext
  • (string) $excluded_categories
See:
Defined at:



Prints link to the next post.

Source


<?php
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;
}
?>

Examples [ wp-snippets.com ]

Top Google Search Results

More ...

0 User Note(s)

None yet. Be the first!

Add New ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics