Support » Developing with WordPress » Get the current comments page number?

  • Hi. Is there a way (by coding) to know the current comments page number we’re on?

    For example if we have 30 comments, 10 comments per page, and I’m on the 2nd or 3rd page, I need to know this page number.

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    get_query_var( 'cpage' ) should work. It’s also in the request URL, which can be found in $_SERVER

    If it’s not defined, it’ll either be page 1 or $wp_query->max_num_comment_pages, depending on the option ‘default_comments_page’ value.

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.