[resolved] If is comment paged ? (4 posts)

  1. SimonJ
    Posted 6 years ago #

    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 ? :-)



  2. Mark / t31os

    Posted 6 years ago #

    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;
  3. SimonJ
    Posted 6 years ago #

    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


  4. Mark / t31os

    Posted 6 years ago #

    You're welcome..

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.