Shop PCMemoryStore.com Today! MacSpeech Dictate 1.5

Friday, April 10, 2009

How to add a comment form beneath your blog posts

·

To enable inline comments for your Blogger powered blog, you need to log into your dashboard. Then go to Settings>Comments and scroll down the page to see the new "Comment form placement" setting:

Check the radio setting for "Embedded below post" which will enable the display of the comment form below your blog posts.

If you have customized your template, you will need to make a small change to your template code for this comment form to display. But don't worry, it's a very simple customization to make!

Simply go to Layout>Edit HTML in your blog's dashboard and check the "Expand widget templates" box. Then search for this section of code:


<p class='comment-footer'> <b:if cond='data:post.allowComments'> <a expr:href='data:post.addCommentUrl' expr:onclick='data:post.addCommentOnclick'><data:postCommentMsg/></a> </b:if> </p>

Replace this entire section of code with the following instead:

<p class='comment-footer'> <b:if cond='data:post.embedCommentForm'> <b:include data='post' name='comment-form'/> <b:else/> <b:if cond='data:post.allowComments'> <a expr:href='data:post.addCommentUrl' expr:onclick='data:post.addCommentOnclick'><data:postCommentMsg/></a> </b:if> </b:if> </p>

Then save your template. Now when you view a post page in your blog, you should see the new comment form in place!

Update: As many of you have pointed out in the comments, not all templates feature the code I've described above.

Luckily, there is another method which is much easier to use, and has worked for every template I've tried so far. So if my original method isn't working for you, try this instead:

Search for this line in your template code:

<b:include data='post' name='comments' />

Immediately after this line, add the following line of code:

<b:include data='post' name='comment-form'/>

Then save your template. This method adds the required code for the comment form without having to alter the whole comment area, and is very useful if you have experienced problems using the original method.

If you don't see your comment form, make sure you have changed this setting and have added your code in the correct place in your template.

You can see this comment form in action beneath this post. Using this comment form allows readers to comment using their Google account, OpenID, Name/URL and all of the settings previously available when using a pop-up or full page comment form (depending on the settings you have chosen).

Please let me know what you think of this new feature by leaving your comments below.


0 comments:

Post a Comment

Related Articles


Related Article Widget by Hoctro

About Me


嗨,我是花,居住在印度兴奋的Windows,Linux中国的外籍人士和所有高科技的东西

Hi, I am Hua, a chinese expat residing in India excited about windows, linux and all things tech

Receive updates for free

Enter your email address:

Delivered by FeedBurner

Mobile Version

Bookmark

Bookmark and Share

Blog Archive

matchmaker.com gold membership valentine's