WordPress.org

Support

Support » How-To and Troubleshooting » allow comments for multi-page posts on last page only

allow comments for multi-page posts on last page only

  • when a page is created and split to create multiple pages, i want to display the comment form only on the last page

    can do?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator Michael

    @alchymyth

    Forum Moderator

    in page.php, wrap the ‘comments_template(()’ code into a conditional statement; example:

    <?php if( $numpages == 1 || ($numpages > 1 && $page == $numpages) ) comments_template( '', true ); ?>

    hi alchymyth
    i tried that snippet and it didn’t work for me

    i use CloudFlare and WP Super Cache, so i dumped all caches, including browser cache, and still didn’t work. no errors

    don’t worry about it though – no big deal

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘allow comments for multi-page posts on last page only’ is closed to new replies.