RSS

Enabling Comments on Every Wordpress Page

Sat, May 17, 2008    (No Ratings, Click to rate this article!) Loading ... Loading ...

Technology


Ok this might seem trivial to the smarter WordPress folks out there, but I’m dumb… dumb like a sack of rocks and didn’t just figure this out until now.

If you’ve been using WordPress for years and always wondered why the ‘Add a Comments’ section only show up on the front page of the blog and nowhere else BUT the admin interface and the rest of WordPress seem to happily support comments on every page then you are in luck.

As it turns out most (if not all?) themes I’ve used for WordPress do not include the comment-enabling snippet of code on the default Page template that is used to render sub-pages of the main site (for example, on this site, like the Contact, About, Reviews, etc. sections).

The trick is to edit the Page template of whatever theme you are using and add the following snippet of code right below the existing post-div (ends with comment: <!–/post–>)

So find that section and right after it, add this new comments div:

<div id="comments" class="box2">
    <?php comments_template(); ?>
</div>

You are now set, every single page on your site will include the Comments section template, and since WordPress already supports pages having comments, there is nothing more to do… it will just suddenly work.

You can see this in action (as an example) over on the kallasoft SmugMug Java API Examples page.

Hope that helps some of you WordPress’ers out there.

Share This on Your Favorite Social Network:
  • Digg
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • Fark
  • Furl
  • Propeller
  • Reddit
  • Technorati
  • StumbleUpon
  • description
  • MisterWong
  • TwitThis
  • Slashdot
  • SphereIt
, ,

This post was written by:

Editor - who has written 1478 posts on The “Break it Down” Blog.

Bringing you summarized technical news, announcement and reviews quickly and to the point.

2 Comments For This Post

  1. Alexander Says:

    Thanks, I just didn´t know how to do it. Now I do. (Big relieve, because other advices could´t help me further). Once again, thanks for sharing. Regards, Alexander

  2. Editor Says:

    No problem Alexander, glad it helped.

Leave a Reply