Support » Fixing WordPress » If is comment paged ?

  • Resolved SimonJ


    Hi all!

    Ok, here is my question :

    I know the conditional tag “is paged”…

    I wonder if there is a similar condition for comment pages…

    Something like : if is comment paged

    I would like to display something if we are currently on a comment page


    Am I clear ? 🙂



Viewing 3 replies - 1 through 3 (of 3 total)
  • Example to output comment page number:
    echo get_query_var('cpage');

    If it doesn’t return a value, then you can assume it’s the first page..

    Can handle the var in the same way as paged… if you want to use it for something..

    Further example:

    $comment_paged = ( get_query_var('cpage') && get_query_var('cpage') > 1 ) ? get_query_var('cpage') : 1;

    Nice nice nice…

    Here is what I did based on your suggestion :

    $page_comment = get_query_var('cpage');
    if ($page_comment > 0) {
    echo 'comment page : '.$page_comment;

    For anyone searching this forum in the future, I was looking for a solution to add the page comment number in the <title> tag in my header, to avoid “double <title> tags” in search engine indexation…

    Another resolved issue! Thanks


    You’re welcome..

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘If is comment paged ?’ is closed to new replies.