-

21 February 2013

Display post author, date, labels and comments with icons below post titles

VM | 3:55 pm |
n this post, i will show you how to add default Author Name, Post Date, Labels and Comments with some little icons to the left of each other. You can see under each of my post title, some details like author name, time when posts have been published, labels and the comment count links. When there are no comments posted the link says 'Be the First to comment!' and when there is just one comment it says '1 comment so far'. This is a nice hack that will make your blog look beautiful and professional.






Let's start adding the codes.

Step 1. Go to Blogger Dashboard > Edit HTML (for safety, backup your template)

Step 2. Check the "Expand widgets templates" box

Step 3. Search for this code:
<div class='post-header-line-1'>

If you can't find it, look for this one:

    <div class='post-header'>

Step 4. Paste  the following code below/after the code above:

<font style='background:transparent url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhLx-mX28SJ0OxkWspXmX0RxNZKDmuxMjNIDvVIsTRWZm9IbprJ3cBuS3XZd1LOOyo9c9iR-CtF8drGJo-hq0DJWa0l4aF1GIBe8Yoz7qSZJUah9sKXbT9Spthie_d5MFg8QoZQWEvweGZN/s1600/author.gif) no-repeat scroll top left;padding-left:25px;font-size:11px;'><data:post.author/></font> | <font style='background:transparent url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiGcGALPcPg6BdLOmn4ooIIzGD6u8toB1fYBtUw7oM0T65c4TYhHC8sZInJnfv2cf_xkabRAONDl3CPUE4j50-KqCZKPcQ8d6ay_YM0vkLPwQPXhYm7tTVvY6jN32FxZpzkiiQwr17Mh3_p/s1600/clock_icon.gif) no-repeat scroll top left;padding-left:25px;font-size:11px;'><data:post.timestamp/></font> | <font style='background:transparent url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh3lmXSQ4sNZdobxZquBi2_8fBKh0KFCzhtps7qQey12Oljp-1Mn846_0_Yalx9zMQ5nfQz-pXp8VoOczCzCxzA4m6D_3ItRRry1KXhCWehh3we4BIqwQnJeLBIUfE06GB9EhRxQKvssHIu/s1600/tag+icon.gif) no-repeat scroll top left;padding-left:25px;font-size:11px;'><b:if cond='data:post.labels'>
<b:loop values='data:post.labels' var='label'>
<a expr:href='data:label.url + &quot;?max-results=8&quot;' rel='tag'><data:label.name/></a>
<b:if cond='data:label.isLast != &quot;true&quot;'>|</b:if>
</b:loop>
</b:if></font>
<span class='post-comment-link' style='Float:right;'>
        <b:if cond='data:blog.pageType != &quot;item&quot;'>
          <b:if cond='data:post.allowComments'>
            <a class='comment-link' expr:href='data:post.addCommentUrl' expr:onclick='data:post.addCommentOnclick' style='background:url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOVxW2Gw-GIeKZnc3QcgsMEZfEW_SxkNdUpMVWPBJQ3Nr1pfNG64D82QHs0m9UF9HQIOxjlfw18-WhERDaSPsQTdyad35hd1jeENdaZRHTssk63JQBlF9t08ojDD8A8iHNnc1dIwuat7U8/s1600/comment-icon.png) no-repeat;Padding-left:20px;'><b:if cond='data:post.numComments == 0'>Be the first to comment!<b:else/> <b:if cond='data:post.numComments == 1'><data:post.numComments/> Comment so far<b:else/><data:post.numComments/> Comments so far</b:if> </b:if></a>
          </b:if>
        </b:if>
      </span>

Details that can be customized:
Replace the code in:
Red (Author)
Green (Date)
Blue (Labels)
Violet (Comment bubble)

... with the URL address of your image.

Step 5. Save template... and you're done!

No comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...

Subscribe Updates, Its FREE!