>>> How to Download Paid Android Apps for Free   >>> Aakash Tablet Good for Blogger to Blog on The Move   >>> Use Automatic Fixed Read More Jump Break With Thumbnail On Blogger   >>> How To Create A Privacy Policy Page To Comply With AdSense TOS   >>> Solution for Common Problems of "Drop Down Menu" for Blogger Blogspot Blog   >>> Best Tutorial to Make CSS Drop Down Menu for Blogger Blogspot Blog   >>> Add Custom Search Box In Blogger Blogspot   >>> Create a Facebook Fan Page for your Blog   >>> Add a Contact Me Page (Form) To Your Blogger/BlogSpot Blog   >>> Add Cool Subscription Widget to Blogger Blogs   >>> How to Setup Your own Domain to Blogger Blogspot Blog   >>> Add background music to your blog   >>> How to Buy Custom Domain For Your Blogspot Blog Via Blogger   >>> Blog's Definition & History In Short Note   >>> How To Remove Low paying Adsense Ads   >>> How To Host Javascript Or .Js Files On Blogger Itself   >>> Adding Numbered Page Navigation Bar For Blogger Blogspot Blog   >>> How To Change Blogger Mouse Cursors In Easy Way   >>> New Blogger App for mobile phones like iPhone, iPad, iPod Touch   >>> How to Delete or Remove Posts From Blogger Blogspot Blog   >>> How to Remove or Change the Blog Title Border in Blogger (Blogspot) - Minima Template   >>> Add or Change Background Image of a Blogger Template   >>> Add a Post Divider Between Blogger Posts   >>> How to Align and Justify Blogger Posts   >>> Guide to Blogger Blogspot FAQs   >>> How To Delete a Blogger Blogspot Blog   >>> Solution to Missing Add a Gadget Feature in Blogger   >>> Free Essential Tools for a Blogspot Blogger   >>> Add 3 Column or 4 Column Footer to Blogger   >>> Add Email This Post Link to Blogger   >>> How to Change Bullet Point Style in Blogger (Blogspot) Lists   >>> Show Date Above Blogger Post Title   >>> Blogger Post Image Borders Change or Remove   >>> Remove Image Border in Default Blogger Templates Simple and Awesome Inc   >>> How to Add a Table to Blogger Blogspot Post   >>> Choose Your Own Blogger Post Date   >>> How to Add a Subtitle to Blogger Posts   >>> Add Profile Images to Blogger Comments   >>> How to Highlight Author Comments in Blogger Posts   >>> Get More Comments on Your Blogger Blog   >>> Blogger Read More Links in Posts with Jump Breaks Feature   >>> How to Add Internal Links Within Blogger Posts   >>> Add Simple Image Slider to Blogger   >>> Add Printer Button or Link to Blogger Blogspot   >>> Add Outbrain Ratings Widget to Blogger   >>> Hide Remove Navbar from a Blogger Blog   >>> Add a Horizontal Links Menu to Blogger   >>> Add a Welcome Message to Blogger Blog   >>> Avoid 6 Common Blogger Mistakes   >>> Add Twitter Badge Button to Blogger   >>> Add a Twitter Followers Counter to Blogger   >>> Tips to Add a Digg Button to Blogger Blogspot   >>> Free Social Bookmark Buttons for Blogger   >>> Add Social Bookmark Buttons to Blogger   >>> Add a Social Bookmarking Button to Blogger   >>> Add Email Subscription Form and Links to Blogger Blogspot   >>> Add a Recent Comments Feed to Blogger Sidebar   >>> Add a Recent Posts Feed to a Blogger Blog   >>> Add a Categories Section to a Blogger Blog (Blogspot Blog)   >>> Add Affiliate Banner Below Post in Blogger   >>> Add an Affiliate Banner to a Blogger Header   >>> Add an Affiliate Banner to Blogger Sidebar   >>> Place Google Adsense Below Post Title in Blogger   >>> Add Google Adsense Below Blogger Post   >>> Add Feedjit Live Traffic Feed to Blogger   >>> Add Google Analytics to a Blogger Blog   >>> Track Visitors to Your Blogger Blog   >>> Submit Blogger Blog to Blog Directories   >>> Submit Your Blogspot Blog Sitemap to Google   >>> Submit Your Blogspot Sitemap to Yahoo   >>> Add a Blogger Sitemap to MSN Bing Webmaster Tools   >>> Submit a Blogger Sitemap to Major Search Engines   >>> Blogger RSS Feeds and Feedburner   >>> Burn Blogger RSS Feeds at Feedburner   >>> Add a Feedburner FeedFlare to Blogger Feed   >>> How to Create Search Engine Friendly Permalinks for Blogger Posts   >>> Adjust Blogger Title Tags to Improve SEO   >>> Add Amazon Product Links to Blogger Posts   >>> Make Money Add an Amazon Widget to Blogger   >>> Add Chitika Ads to Blogger Blogspot   >>> Earn Money with Chitika and Blogger   >>> 5 Easy Ways to Make Money from Blogger   >>> Make Money Add Banners Ads to Blogger   >>> Blogger Guide to Google Adsense Placement   >>> Add Banner Adsense Above Blogger Header   >>> Bloggers Guide to Google Adsense Myths   >>> Add Google Adsense to Blogger Header   >>> Better Placement of Google Adsense in Blogger   >>> Google Adsense Tips for a Blogger Blog   >>> Add Paypal Donate Button to Blogger   >>> Increase Google Page Rank Blogger Blogspot   >>> Make Money With Adsense Keywords and Blogger   >>> Add Meta Tags to Blogger for Better SEO   >>> Add Breadcrumb Navigation to Blogger Blogspot   >>> Blogger Blogspot SEO Tips and Tricks   >>> 10 Tips to Build Blogger Blogspot Site Traffic   >>> Embed a Comment Form in Your Blogger Posts   >>> List of How Blog Works Blogger Tutorials   >>> Add Missing Embedded Comments Form to Blogger   >>> How to Add Missing Quick Edit Wrench to Blogger      + Grab this Widget on howblogworks

Thursday, September 01, 2011


How to Highlight Author Comments in Blogger Posts

In this Blogger tutorial I will show you how to highlight the author comments section of your Blogger template (Blogspot template) using CSS styling.

Benefits of Adding CSS Styling to Author Comments
If you are using a default Blogger template chances are it is difficult to differentiate between comments made by visitors and comments made by you, the blog author. If you only have a few comments per post that may not be enough of an issue for you. If however, you have some posts with lots of comments you may need to make your remarks stand out from those of your visitors. We can do that by adding CSS styling to highlight your author comments.

What Will I Learn in This Tutorial?
In this Blogger tutorial you will learn how to easily add some highlighting to your comments so that they will never get lost in the crowd again. This requires a small amount of tweaking to your Blogger template which is not difficult to do if care is taken. The image below shows one example of what can be achieved using this Blogger hack and some CSS styling.


Will This Blogger Hack Work on My Template?
I have tested this Blogger hack on both the old generation of Blogger templates (Minima and Sand Dollar) and the latest generation of default Blogger templates eg Simple. It will also work on custom templates as the comments code is likely to be very similar.

If you are using a custom Blogger template and run into difficulty you can also try this alternative method to highlight author comments in Blogger posts

How to Add CSS Styling to Author Comments in a Blogger Post
The following instructions will highlight author comments in the comments section of a Blogger post. The code creates a shaded box around the comments made by the blog author. These changes will not affect the CSS the styling of any of the other comments made.

Instructions to Add CSS Highlighting to Author Comments in Blogger

  1. Login to Blogger
  2. From the Dashboard go to Design > Edit HTML
  3. Back up your template by downloading it to your computer
  4. Check the Expand Widget Templates checkbox on the top righthand side
  5. Use CTRL + F by entering the following into the search box


    <dd class='comment-body'>

  6. Immediately above this line paste the following code:


    <b:if cond='data:comment.author == data:post.author'>
    <dd class='comment-body-author'>
    <p><data:comment.body/></p>
    </dd>
    <b:else/>

  7. Now look for this code block


    <dd class='comment-body'>
    <b:if cond='data:comment.isDeleted'>
    <span class='deleted-comment'><data:comment.body/></span>
    <b:else/>
    <p><data:comment.body/></p>
    </b:if>
    </dd>


    and paste </b:if> immediately after it.
  8. Your code will now look like this:


    <div expr:id='data:widget.instanceId + &quot;_comments-block-wrapper&quot;'>
    <dl expr:class='data:post.avatarIndentClass' id='comments-block'>
    <b:loop values='data:post.comments' var='comment'>
    <dt expr:class='&quot;comment-author &quot; + data:comment.authorClass' expr:id='data:comment.anchorName'>
    <b:if cond='data:comment.favicon'>
    <img expr:src='data:comment.favicon' height='16px' style='margin-bottom:-2px;' width='16px'/>
    </b:if>
    <a expr:name='data:comment.anchorName'/>
    <b:if cond='data:blog.enabledCommentProfileImages'>
    <data:comment.authorAvatarImage/>
    </b:if>
    <b:if cond='data:comment.authorUrl'>
    <a expr:href='data:comment.authorUrl' rel='nofollow'><data:comment.author/></a>
    <b:else/>
    <data:comment.author/>
    </b:if>
    <data:commentPostedByMsg/>
    </dt>


    <b:if cond='data:comment.author == data:post.author'>
    <dd class='comment-body-author'>
    <p><data:comment.body/></p>
    </dd>
    <b:else/>


    <dd class='comment-body' expr:id='data:widget.instanceId + data:comment.cmtBodyIdPostfix'>
    <b:if cond='data:comment.isDeleted'>
    <span class='deleted-comment'><data:comment.body/></span>
    <b:else/>
    <p>
    <data:comment.body/>
    </p>
    </b:if>
    </dd>

    </b:if>

    </dd>
    <dd class='comment-footer'>
    <span class='comment-timestamp'>
    <a expr:href='data:comment.url' title='comment permalink'>
    <data:comment.timestamp/>
    </a>
    <b:include data='comment' name='commentDeleteIcon'/>
    </span>
    </dd>
    </b:loop>
    </dl>
    </div>

  9. Now using CTRL + F again find this line ]]></b:skin>
  10. Paste the following immediately before ]]></b:skin>


    .comment-body-author {
    background: #f5deb3;
    border: 2px solid #de7008;
    padding: 5px;
    }

  11. Save your template changes
  12. Click on View Blog and go to a post that you have commented on to see the CSS styling has highlighted your comments.


Alternative Method to Add Highlighting to Author Comments in Blogger
The following method will also add highlighting to author comments in Blogger and can be used if you have difficulty with the first method. It does however involve changing some code rather than just adding some so this is not as desirable in terms of future proofing your template for Blogger updates.


  1. Login to Blogger
  2. From the Dashboard go to Design > Edit HTML
  3. Back up your template by downloading it to your computer
  4. Check the Expand Widget Templates checkbox on the top righthand side
  5. Find the following section of code by using CTRL + F and entering <data:comment.body/> into the search box


    <span class='deleted-comment'><data:comment.body/></span>
    <b:else/>
    <p><data:comment.body/></p>
    <b:include data='comment' name='commentDeleteIcon'/>
    </b:if>

  6. Replace with the following code after <span class='deleted-comment'> and before </b:if> as shown in red:


    <span class='deleted-comment'>
    <!--Highlight Author Comments Start-->
    <b:if cond='data:comment.author == data:post.author'>
    <p class='comment-body-author'><data:comment.body/></p>
    <b:else/>
    <p><data:comment.body/></p>
    </b:if>
    <!--Highlight Author Comments End-->

    </b:if>

  7. Use CTRL + F to find ]]></b:skin> that closes the CSS styling section
  8. Paste the following code immediately above ]]></b:skin>


    p.comment-body-author {
    background: #eeeecc;
    border: 2px solid #335577;
    padding: 5px;
    color:#558866;
    }

  9. Save your template
  10. Click on View Blog and navigate to a post that you have commented on to see the that your comments will now be highlighted


In this Blogger tutorial you have learned two different methods to add CSS styling to highlight the author comments in your Blogger posts. Obviously there is still some work to do on your part to adjust the colors in the CSS styling to match the color scheme of your blog. Good luck!


Related Articles
List of How Blog Works Tutorials for Blogger Blogs
Embedding a Comment Form Below Each Post
How to Get More Comments on Your Blogger Blog
Add Missing Embedded Comment Form to Blogger

No comments:

Post a Comment