What is the correct way of removing the comments from the page template?

This topic contains 7 replies, has 2 voices, and was last updated by  Guust 10 years, 1 month ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #24412

    frantletle
    Full Member
    Post count: 91

    What is the correct way of removing the comments from the page template?

    #24421

    Guust
    Moderator
    Post count: 29970

    In the wordpress settings:

    WP admin > Settings > discussion > Default article settings > Allow people to post comments on new articles > Un-tick

    It is not really in any template, and turning it off there will not turn it off for existing pages and posts and listings.
    You can also control this on a post by post basis.

    #25414

    frantletle
    Full Member
    Post count: 91

    actually, that still leaves the comment form on the page.

    I did discover this though:

    plugins/geodirectory/geodirectory-functions/comments_functions.php

    and noticed hooks, etc.. being used. I could probably make the file blank, but prefer the right way using hooks/filters etc

    #25420

    Guust
    Moderator
    Post count: 29970

    “You can also control this on a post by post basis.”
    When you change the main WP settings, that does not change the settings for posts and pages already created.
    So you need to go to these posts and untick the “allow comments” box.

    #25429

    frantletle
    Full Member
    Post count: 91

    It shows up on Pages as well–no way to untick.

    It shows up in other account areas as well.

    IS there NOT a way to use hooks to REMOVE the form altogether?

    #25430

    Guust
    Moderator
    Post count: 29970

    Make sure you tick “Discussion” in screen options.

    There is probably a way to edit your templates, but there is really no need for it.

    The file you refer to would have nothing to do with pages, comments on pages are WP and theme controlled.
    And if you want to hide comments from the GD listings, GD > design > detail > Exclude selected tabs from detail page > reviews

    #25458

    frantletle
    Full Member
    Post count: 91

    I want reviews. Just not comments. Anyways, I will work to modify the theme so the comments template doesnt show up in random places.

    #25460

    Guust
    Moderator
    Post count: 29970

    If you do not want to use the WP settings to disallow comments, you can just remove this from your page templates:

    <?php comments_template(); ?>
Viewing 8 posts - 1 through 8 (of 8 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
20% Discount Offer
Hurry! Get your 20% discount before it expires. Get 20% Discount