Support » Themes and Templates » Conditional Tag for Paged Comments?

  • I’m wondering if there is a conditional tag for checking to see if you are on a page that has paginated comments? I want to have the first page of comments appear under the post (like normal) however if a user clicks to page 2 or more of the comments, like http://www.example.com/example-post/comment-page-1/#comments I don’t want to display the post again… only the comments. So I’m looking for a conditional tag to put into my theme so that the original post won’t display again when someone flips to page 2 (or beyond) of the comments. Sure, I could check the URL for the ‘comment-page-‘ string– but I’m looking for a cleaner way.

Viewing 3 replies - 1 through 3 (of 3 total)
  • If there isn’t a conditional tag, does anyone have another way other than checking the URL?

    I figured this one out. There is a variable called $cpage you can check. So I basically said “if $cpage < 1 display the page excerpt, else display the full page content”, then the comments are displayed. This eliminates a duplicate content issue.

    Thanks for sharing,

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Conditional Tag for Paged Comments?’ is closed to new replies.