Forums

Hide Comment form on individual post (6 posts)

  1. clay
    Member
    Posted 7 years ago #

    On my site I have a rewrite which directs the homepage to a specific post but I would like to get rid of the comment stuff at the bottom
    Is there anyway to do something like:
    http://www.example.com/post?p=9&nocomments
    ?

  2. moshu
    Member
    Posted 7 years ago #

    can't you just go back in admin panel to the post, then click edit... and uncheck the "allow comments" box?

  3. clay
    Member
    Posted 7 years ago #

    I don't want to disallow comments though- I only want to not display the comment form and data in certain instances

  4. clay
    Member
    Posted 7 years ago #

    Or even if I can set it so that when viewing individual posts it displays a link to display the comment form

  5. clay
    Member
    Posted 7 years ago #

    I got it-
    Added an if/else statement which matches the post I don't want to display the comments on- then I modified the wp-comments-popup.php file so when 'leave a comment' is clicked it loads what you would normally see on an individual entry
    <?php
    if ($id != 9) :
    include(ABSPATH . 'wp-comments.php'); ?>
    <?php else: ?>
    <div class="feedback">Leave a Comment</div>
    <?php endif; ?>
    </div>

  6. clay
    Member
    Posted 7 years ago #

    Scrapped the if/else statement and just made every entry have a 'leave a comment' link which points to the comment page

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.