WordPress.org

Ready to get started?Download WordPress

Forums

allow comments for multi-page posts on last page only (3 posts)

  1. wp.Man
    Member
    Posted 1 year ago #

    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?

  2. alchymyth
    Forum Moderator
    Posted 1 year ago #

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

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

  3. wp.Man
    Member
    Posted 1 year ago #

    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

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.