Switch language

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




get_next_comments_link [ WordPress Function ]

get_next_comments_link ( $label = '', $max_page = 0 )
Parameters:
  • (string) $label Optional. Label for link text.
  • (int) $max_page Optional. Max page.
Returns:
  • (string|null)
Defined at:



Return the link to next comments page.

Source


<?php
function get_next_comments_link$label ''$max_page ) {
    global 
$wp_query;

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

    
$page get_query_var('cpage');

    
$nextpage intval($page) + 1;

    if ( empty(
$max_page) )
        
$max_page $wp_query->max_num_comment_pages;

    if ( empty(
$max_page) )
        
$max_page get_comment_pages_count();

    if ( 
$nextpage $max_page )
        return;

    if ( empty(
$label) )
        
$label __('Newer Comments &raquo;');

    return 
'<a href="' esc_urlget_comments_pagenum_link$nextpage$max_page ) ) . '" ' apply_filters'next_comments_link_attributes''' ) . '>'preg_replace('/&([^#])(?![a-z]{1,8};)/i''&#038;$1'$label) .'</a>';
}
?>

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