Switch language

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




previous_post [ WordPress Function ]

previous_post ( $format = '%', $previous = 'previous post: ', $title = 'yes', $in_same_cat = 'no', $limitprev = 1, $excluded_categories = '' )
Parameter:
  • (string) $format
  • (string) $previous
  • (string) $title
  • (string) $in_same_cat
  • (int) $limitprev
  • (string) $excluded_categories
Siehe:
Definiert in:



Prints link to the previous post.

Source


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

Beispiele [ wp-snippets.com ]

Top Google Suchergebnisse

Mehr ...

0 Nutzerkommentare

Noch keine. Sei der Erste!

Neu hinzufügen ...



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