Switch language

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




paginate_comments_links [ WordPress Function ]

paginate_comments_links ( $args = array() )
Parameters:
See:
Returns:
  • (string) Markup for pagination links.
Defined at:



Create pagination links for the comments on the current post.

Source


<?php
function paginate_comments_links($args = array()) {
    global 
$wp_rewrite;

    if ( !
is_singular() || !get_option('page_comments') )
        return;

    
$page get_query_var('cpage');
    if ( !
$page )
        
$page 1;
    
$max_page get_comment_pages_count();
    
$defaults = array(
        
'base' => add_query_arg'cpage''%#%' ),
        
'format' => '',
        
'total' => $max_page,
        
'current' => $page,
        
'echo' => true,
        
'add_fragment' => '#comments'
    
);
    if ( 
$wp_rewrite->using_permalinks() )
        
$defaults['base'] = user_trailingslashit(trailingslashit(get_permalink()) . 'comment-page-%#%''commentpaged');

    
$args wp_parse_args$args$defaults );
    
$page_links paginate_links$args );

    if ( 
$args['echo'] )
        echo 
$page_links;
    else
        return 
$page_links;
}
?>

Examples [ wp-snippets.com ]

Google Arama Sonuçlarý

Dahasý ...

Kullanýcý Tartýþmalarý [ wordpress.org ]

- Bulunamadý -

Yeni bir konu yaz ...

0 User Note(s)

Henüz yok. Ýlk sen ol!

Yeni Ekle ...



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