Tuesday, May 22, 2012

How to remove 'Leave a Reply' from Twenty Eleven' pages when it WON'T go away


WHYY!?

Sometimes, no matter how many times you use a Wordpress theme they way it wants to be used, it doesn't work the way you need it to. The obvious solution to remove the 'Leave a Comment' or 'Leave a Reply' section on posts and pages when using Twenty Eleven (or Twenty Ten, if you're stubborn) is to uncheck 'Allow people to leave new comments' on Settings>Discussions - but alas, that doesn't work. Or, I guess it does, but not the way any sane person would want it to (the 'Leave a Reply' window remains displayed, you just aren't allowed to use it). 
You can also try going to Pages>All Pages and clicking Quick Edit on the page that is making you crazy, and unchecking the 'Allow Comments' box, but chances are you will just start tearing out more of your hair - because that won't make the *%$@# form go away either. 
Never fear - I found the solution!
If you are comfortable editing theme files, go into page.php (where your theme uses the comment function) and remove or comment out the function. It may look something like this:
<?php comments_template(); ?>
To comment it out (make it not have any effect on your site) put two slashes in front of it, like this:
<?php // comments_template(); ?>
Make sure you backup your theme before making any changes!!

13 comments:

  1. Fill your coaching programs
    Such a nice blog and having very good knowledge about our business tree and many But if you are or any other one can new in business environment and wants some business advises then you can contact us.

    ReplyDelete
  2. Hi
    This is really nice blog because this blog is very informative related to SEO .I hope this blog rank high in search engines.

    ReplyDelete
  3. Keep up the superb piece of work, I read few posts on this web site and I think that your weblog is real interesting and contains circles of excellent information.
    Click here for Los Angeles janitorial services

    ReplyDelete
  4. This can be such a good website and some incredibly good articles. I am deeply impressed on how much effort you’ve put into this site. Maintain up the very good perform I’ll look over shoulder again later.

    ReplyDelete
  5. Useful info. Hope to see more good posts in the future.
    Visit me...here!

    ReplyDelete
  6. This comment has been removed by the author.

    ReplyDelete
  7. great!! this is the reason for loosing power of website.
    you can learn codeigniter tutorial

    ReplyDelete
  8. This comment has been removed by the author.

    ReplyDelete
  9. great!!! visit for 6 months industrial training in Noida
    http://www.apextgi.in/

    ReplyDelete
  10. Great Blog...thanks for sharing
    I have also found the Best Node.js tutorials

    ReplyDelete
  11. Spot on with this write-up, I truly think this website needs much more consideration. I’ll probably be again to read much more, thanks for that info.

    MDS Service

    ReplyDelete
  12. Really informative blog. I hope you write again these kind of Blog. Thanks for sharing helpful information. standard cleaning service

    ReplyDelete