The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

[resolved] nextpage tag (pagination) and duplicate comments! (3 posts)

  1. invasive
    Posted 5 years ago #

    Hi Guys,

    I just found something that might be a problem for duplicate content. It seems that if you break a post up into pages (<!--nextpage--> tag) the comments that people leave are duplicated across every page.

    Any idea how to get around this problem? (Like: only show comments on the "last" page of a post)


  2. Michael
    Forum Moderator
    Posted 5 years ago #

    $page and $numpages are the global variables for the pages of a paginated post/page:

    this will only show the comments and comment form on the last of the paginated parts:

    <?php if( $page == $numpages ) comments_template( '', true ); ?>
  3. invasive
    Posted 5 years ago #

    That works great, thanks!

Topic Closed

This topic has been closed to new replies.

About this Topic