Thursday, July 30, 2009

How to add a calendar icon as date header

dateheadericon From this tutorial, you will be able to add your very own calendar icon to your blogger! If you’re going to show the date on every post, why not do it with a little style and make it a little more appealing to viewers? If you want your calendar icon to appear on every post, read Blogspot Vision’s post on how to do that by clicking here to go to the post. Let’s get started but first and foremost, make sure you back-up your existing template, just in case it doesn’t turn out as expected.

Steps to follow:

1. Login to your Blogger dashboard

2. Go to Layout > Edit HTML (Click on “expand widgets” box)

3. Search for the following section code: ]]></b:skin>
and add the following section code below right before it:

.post .date {
    height: 50px;
    width: 45px;
    background: url(http://www.blogspotvision.com/bspotvision/itheme-calendar.gif) no-repeat;
    font: normal 22px Arial;
    color: #666666;
    text-align: center;
    padding: 0px 2px 0 0;
    line-height: 100%;
    float: left;
}
.post .date span {
    height: 16px;
    display: block;
    font: normal 11px Arial;
    color: #ffffff;
    text-align: center;
    padding-top: 5px;
}

4. Next, you will need to search for the following section code: <b:if cond='data:post.title'>
and add the following section code below right after it.

<div CLASS='post'>
<script type='text/javascript'>
    var timestamp = &quot;<data:post.timestamp/>&quot;;
    if (timestamp != &#39;&#39;) {
        var timesplit = timestamp.split(&quot;,&quot;);
        var date_yyyy = timesplit[2];
        var timesplit = timesplit[1].split(&quot; &quot;);
        var date_dd = timesplit[2];
        var date_mmm = timesplit[1].substring(0, 3);
    }
</script>
<div CLASS='date'>
<span><script type='text/javascript'>document.write(date_mmm);</script></span>
<script type='text/javascript'>document.write(date_dd);</script>
</div> </div>

5. Preview your page before Saving Template, and if all works fine, Save Template.

Note: You might have to adjust the post title margin and padding to fit your style of blog, you can also find free calendar icons in the icons section!

6. Next, you will need to adjust your settings by clicking Settings > Formatting > Timestamp Format, and adjust it to Sunday, August 02, 2009.

calendariconsettings Your done!

17 comments:

  1. wa's happenin yo. site's lookin good

    ReplyDelete
  2. whats up jon jon. appreciate the support bro

    ReplyDelete
  3. I need help! I do this and it works great but I need help! The break between posts gets screwed up with the calendar. Look:http://uiofhgsiufhgasofuyghasdfyasgfy.blogspot.com/

    On my main blog I removed the break between posts but is there a way to keep the break but not mess it up?

    This is my main blog: http://www.freebie-link.com/

    ReplyDelete
  4. hey admin, it looks like you have a break on top and bottom of posts? what youll need to do is modify the padding of:

    .post .date {width: 60px; height: 60px;
    background: url(http://www.blogspotvision.com/bspotvision/DateIcon/PNG/bluecopy.png) no-repeat;
    font: normal 22px Arial;
    color: #666666;
    text-align: center;
    padding: 0px 4px 0 0; <-----
    line-height: 100%;
    float: left;
    }

    next, you will also need to modify post titles.

    .post h3 {
    background: url(http://www.blogspotvision.com/bspotvision/postheaderbg.jpg) top left no-repeat;
    height:59px;
    font: bold 20px Arial;
    padding: 0px 0px 0px 0px; <------
    margin: 0px 0px 0px 0px; <------

    let me know if this doesn't work, because then youll need to modify your html section.

    ReplyDelete
  5. oh i forgot to mention, your post titles may be slightly different.

    ie.

    .post h1,.post h2,.post h3,.post h4,.post h5 ... etc

    ReplyDelete
  6. what does it mean when it says "undefined undefined"?

    ReplyDelete
  7. hey Jess, i think you may have an undefined variable. variables are usually font colors, font texts, or colors of your template that is defined in the variable section of your template(right below your head section). to fix that you have to 1. define your variable or 2. add the actual code of color or text.

    for example:
    the code you got off a tutorial page might have--

    font: $blogDescriptionFont;

    you would have to delete the $blogDescriptionFont and replace it with an actual color code, ex. #3b3b3b

    ReplyDelete
  8. hello tried to look it but I can not aparc the calendar on my blog, I created a blog to test the code that is http://tempoblogger.blogspot.com/

    ReplyDelete
  9. Help please! I added it but look what it does to my blog:

    http://freebielinktest.blogspot.com/

    Please help ASAP

    ReplyDelete
  10. my pleasure, be sure to check out the icons section for other calendar icons.

    ReplyDelete
  11. On my site I have a calendar, but I can't make it so the image doesn't repeat itself when the date is shared with a more recent post... as in... I would prefer the calendar image disappear on earlier posts if they are all on the same day... any idea how I can do that?

    To see what I am talking about my site is at: http://www.mightybuying.com

    ReplyDelete
  12. Hi...

    Why after I edited 'Calender Icon' my divider become twice.

    Check my blog at http://irsyaduna.blogspot.com/

    ReplyDelete
  13. hey wassini, have you checked your posts? or post body? also make sure to check you main widgets section too

    ReplyDelete
  14. I've been wanting to use this icon for one of my blogs. This works wonders! Thanks a lot :)

    ReplyDelete
  15. Hey i really like your site. i've been wanting to improve the look of my blog but i'm ready for wordpress yet! Question I've added the date but how do I get it to come out on the left side of the post/blog as opposed to on top?
    Thanks
    sassysweeets.blogspot.com

    ReplyDelete
  16. I meant not ready for wordpress!

    ReplyDelete
  17. I have tried today to implement the add calender but it does not work there is still this "date undefiened"

    ReplyDelete