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!!

9 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. I think this kind of a blog must rank higher in the search engines. I also subscribed to your RSS feed.
    content management

    Web Design Newzealand

    ReplyDelete
  3. 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
  4. 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
  5. 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
  6. Useful info. Hope to see more good posts in the future.
    Visit me...here!

    ReplyDelete
  7. This site and this post very help full for all visitor any can get help by read this content and site.

    Or any body can get more help this wp web design site.

    ReplyDelete
  8. Cool article, that is interesting that columns have been around us in every day life and we put them in our designs thinking we are creative.
    webdevelopment.ae

    ReplyDelete