This isn't a normal PHP query to me, so not sure how to do it. Whether I need to add a function and puts something in there, so that $comments_content is only empty when it is used. I don't know. Any help would be great.
This query is in wp-includes/link-template.php.
Code: Select all
function paginate_comments_links( $args = array() ) {
global $wp_rewrite;
if ( ! is_singular() )
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_<span style='color:blue' title='I'm naughty, are you naughty?'>smurf</span>(<span style='color:blue' title='I'm naughty, are you naughty?'>smurf</span>(get_permalink()) . $wp_rewrite->comments_pagination_base . '-%#%', 'commentpaged');
$args = wp_parse_args( $args, $defaults );
$page_links = paginate_links( $args );
if ( $args['echo'] )
echo $page_links;
else
return $page_links;
}