Langsung ke konten utama

Adding Threaded Comments To A Customized Blog (Updating My Blogger Template)

Since deciding to update my Blogger template, one of the features I've been most looking forward to using is threaded comments. This enables us to reply directly in response to comments left on a post.

After diving into reams of code and going a very long way about updating my template to include this feature, I stumbled across a very simple way to add this functionality to older Blogger templates.

To help anyone else using a custom Blogger template include threaded comments for their site, I've written this quick tutorial which (unlike my original method!) should get you up and running with comment replies in no time!



Ensure your blog meets the requirements for threaded comments to be displayed

There are two main settings you should change if you would like to display threaded comments in your Blogger site:
  1. Ensure your blog feeds are set to "Full" in Settings>Other
  2. Choose to "embed" your comment form below your post in Settings>Posts and Comments
Once you have saved these settings, it's time to check your Blogger template's HTML code.

Add the required code to your Blogger template

Next, go to Template and click the Edit HTML button. On the warning page, choose to proceed, then make sure you have checked the "Expand Widget Templates" box.

Now search for the following line of code:

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

If your template does not include this line of code, chances are you're already using an updated Blogger template and do not need to proceed any further.

If you do find the above line of code, replace it with the following:

<b:if cond='data:post.showThreadedComments'>
  <b:include data='post' name='threaded_comments'/>
<b:else/>
  <b:include data='post' name='comments'/>
</b:if>

Preview your template to ensure you haven't made any mistakes in pasting the code, and if all is well, save your template.

Now when you view a post's comments section, you should see a "Reply" link beneath any existing comments. When you reply to a comment, a comment form will appear under the comment you are responding to, and your responses will appear beneath.

Thanks to this post on the Blogger Developers Site for the simplified explanation!


Did you find this post useful?


If you've used this tutorial to update your existing Blogger template, please let us know if you found it useful in the comments section below.

Blogger Icon by Double-J Designs

Komentar

Postingan populer dari blog ini

Free Blogger Backgrounds And Textures To Spice Up Your Site

Background images can instantly transform the appearance of our Blogger sites. Using the Blogger template designer, we can easily upload and configure a new background image in just a few clicks, while those using older templates need only add a few lines of code to achieve a dramatic effect. In this post, you'll find resources for hundreds of different free backgrounds, patterns and textures you can use to spice up your Blogger site, along with instructions for applying this simple but extensive effect. Large background images Large background images enable us to display a single large image behind the main content of our site, such as a photograph or complementary texture. Here is a selection of excellent resources for large background images and textures: HOT Bliggity Blog Provides a huge selection of large background images with a contrasting central panel to offer contrast for the main site content. Shabby Blogs A beautiful col...

How To Add A Music Player In Blogspot

Since this archived post was written in 2007, web design and Blogger templates have changed immensely. The development of HTML5 and <audio> tags enable us to add music to our Blogspot websites and posts far more simply, and with improved control. In preparation for explaining how to podcast with Blogger, this tutorial explains how to easily add an HTML5 mp3/audio player to your blog posts or layout. No JavaScript, Flash or plugins are required, and with a fallback for older browsers which don't support the player. I've even created a simple form to generate basic tags for you! Adding music to your Blogspot site has never been so easy! Basic HTML5 Audio Tags Explained The <audio> tag is a new feature of HTML5 which we can use to natively embed audio playback in our sites. It is supported in Internet Explorer 9, Firefox, Opera, Chrome, and Safari, and can be set to play the linked audio file automatically (autoplay) or loop if required. Here...

How To Add Google+ Updates Gadget To Blogger

As yet, there is no official "widget" or RSS feed which we can embed in Blogger to display a stream of our recent posts on Google Plus. Luckily, Google+ to RSS offers a free service enabling us to generate an RSS feed for our personal profiles and pages which we can add to a simple Feed gadget in Blogger. Take a look at the sidebar to see this technique in action and read on to find out how to add a Google+ updates gadget in your own Blogger site. To get started, head over to Google+ to RSS and create a feed for your Google+ profile . You'll need to log in using your Google+ account to allow the app to access your profile stream: As soon as you've done this, you'll be able to "manage your entries" and locate the URL for your Google+ profile  RSS feed: Right-click the RSS icon beside your profile and choose to copy the link location. This is the URL to the RSS feed of your personal profile stream. To publish a feed for a Google+ Page...