Forums

Removing commet pain on homepage? (5 posts)

  1. fleemail
    Member
    Posted 2 years ago #

    How can I remove the comment pain on the homepage of my site http://lawtonfitness.com/ ?

  2. crayoncrisis
    Member
    Posted 2 years ago #

    Try removing the line
    <?php comments_template(); ?>
    from your single.php

  3. stiand
    Member
    Posted 2 years ago #

    You can disable comments in Pages and Posts in the editor. Edit the page, and find the «Discussion»-section somewhere near the bottom. Disable * Allow comments on this post and * Allow trackbacks and pingbacks on this post

  4. crayoncrisis
    Member
    Posted 2 years ago #

    Ah, much better option from stiand.

    (Other themes might leave something like "Comments are closed.", then my suggestion would get rid of everything related to comments.)

  5. stiand
    Member
    Posted 2 years ago #

    Getting rid of everything related to comments is no good if you want comments on some pages/posts, but not on others. My suggestion would be to modify the template-files (usually single.php and/or page.php) and replace

    <?php comments_template(); ?>

    with

    <?php if(comments_open()) comments_template(); ?>

    Then the comments template-file will only be loaded if comments are allowed on the post/page, but not otherwise. Then you don't get the «Comments are closed»-message.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags