Support » Fixing WordPress » turn comments on/off

  • The dilemma is: comments on for posts. But comments off for web site pages. Does that make sense? Do you accomplish comments on for the whole site or for each element separately? Thanks.

Viewing 10 replies - 1 through 10 (of 10 total)
  • Go into your theme files and find page.php. In page.php, you will see <?php comments_template( '', true ); ?>. Delete it or comment it out.

    Say what?? Do have to go into HTML to do this and find <?php comments_template( “, true ); ?> Would it be at the bottom on the HTML code page? Am I doing this globally or a page at a time?

    WHat does “comment it out” mean? If I want comments on for everything what should I do?
    Here is my site: http://www.thisbespokelife.com

    Appreciate your patience. L.

    Don’t worry, it’s just one change on one page and it will affect all of your pages. 🙂

    Go to Appearance -> Editor. Then on the right, click on “Page Template”. You should see <?php comments_template( ", true ); ?> somewhere near the bottom. Change it to <?php// comments_template( ", true ); ?>, <!--<?php comments_template( ", true ); ?>-->, or delete it entirely. Then click on update file and turn your comments back on (I notice you have them turned off site-wide at the moment).

    After you’ve done that and turned comments back on, people will only be able to comment on posts and not pages.

    Call me crazy. I went all the way to the bottom and there was the word comments in little gray text.Way at the bottom. Since I only have 3 subscribers I don’t think there will be tons of traffic. So am I the only person who sees that little gray text at the bottom of the pages? I actually like that the big ugly comments box doesn’t appear on the page, yet someone could still contact me.

    I understand your post above better.

    If you know things to improve my efforts I’d love to hear from you.

    Best,

    This is what I see:

    • one comment for your post “Reading and Writing” and an option to comment
    • comments off for your posts made in August
    • No option for comments on your Food/Cooking/Eating page
    • An option to post comments on your page on Scotland

    Is this what you want? I imagine not…

    After several hours, I’m so sorry but I can’t find a string of code like this:

    Go to Appearance -> Editor. Then on the right, click on “Page Template”. You should see <?php comments_template( “, true ); ?> somewhere near the bottom. Change it to <?php// comments_template( “, true ); ?>, <!–<?php comments_template( “, true ); ?>–>, or delete it entirely. Then click on update file and turn your comments back on (I notice you have them turned off site-wide at the moment).

    From the kitchensink, I chose appearance-Editor-then, Page template from the right sidebar. But there is nothing there that begins
    <?php comments_template(… and ends ; ?>–>

    What am I doing wrong? I like the little gray text at the bottom with the word Comment. I’m happy to have that on every post and every page, I guess, because it is subtle. Isn’t there a global comments-on option? A widget that doesn’t require writing code?

    I finally got a background color, but the choices are so garrish that I can’t stand them. All too bright.

    Global comments on? Go to Settings -> Discussion, and check “allow people to post on new articles”. This way, comments will be on for your pages too but it’ll display the comments field whenever you view an individual post or page. What templates are you using for your pages?

    You’re using the Twenty Ten theme, right? Okay, it’s been a while since I’ve looked at it. The page you need to modify is loop-page.php, using the same method I mentioned earlier, and change <?php comments_template( '', true ); ?> to <?php// comments_template( '', true ); ?>.

    Edit: scrap that last part. Just go Appearance -> Background, and instead of using one of the colors under “Select a color,” go here, get your color, and copy and paste that code into the field next to background color.

    “Allow people to post on new articles” was checked yesterday. Is it checked right now.

    On the loop-page.php? I do this:
    I delete the line beginning: <?php comments_template( ", true ); ?>
    and insert:
    <?php// comments_template( '', true ); ?>
    Does this bit of code activate comments globally? On the loop-page.php?

    I fear messing with code as I know the disasters that can happen.

    You can easily turn off commenting on pages by going to the Pages screen from your admin menu, where it lists all of the pages you’ve created on your site.

    Next, select the checkbox in the top left corner of your list of pages, which should highlight every page you’ve created. From there, click on the “Bulk Actions” dropdown, select “Edit,” and then hit “apply.” You should now see something like this: http://cl.ly/image/2A393B3I422y

    In the list of options on the right side of the bulk edit screen, you will see “Comments.” Click on that dropdown and select “Do not allow.”

    Finally, click the “update” button and you should be all set.

    (Note: If you have too many pages, you’ll have to do this once per screen of pages you have.)

    You can also manually turn off commenting on specific pages by going to hovering over the page you want to edit, clicking “quick edit,” and unchecking “allow comments.”

    I’d avoid removing or adding any code to your theme, especially as there is a way through the admin interface to turn off commenting on pages. If you edit your theme code and then update it, the update will overwrite any changes you made to the code.

    Well, you could just create a child theme based on Twenty Ten in that case. 🙂 I’ll be honest, I create my own themes so updates aren’t an issue with me and modifying the code means that I can just turn off comments on all of my pages without having to remember to do it later.

    In case you do still want to modify your theme manually, make sure “allow people to post on new articles” is checked, then make the change I specified in loop-page.php.

    Check your most recent post too. Comments are turned off for that, which I don’t think you want.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘turn comments on/off’ is closed to new replies.