Replace Date with a cool new calendar type layout in blogger
23 COMMENTS
|
|
|
Lauren asked me to show how to add a calendar to dates in blogger and i liked the idea and so i am posting about it. I also want to say that my readers can also contact me via the contact form or twitter (@virtuosoblogger) or even discuss on the facebook page.
The default text for date in blogger might look a little too simple to some, so for those blogger users who want to spice their layout by adding a calendar to their post dates, this post will help you achieve that.
Follow these steps to replace the default with the date in calendar layout:
1. Go to Settings->Formatting and change the Date Header Format with the format DD-MM-YY
2. Go to layout, then click on Edit Html
3. Download the Full Template (So that you don’t lose any date).
4. Search for the following code:
<data:post.dateHeader/>
5. Replace the code above with the following code:
<div id=’date’>
<script> replace_date('<data:post.dateHeader/>');
</script>
</div>
6. Search for the following code:
</head>
7. Paste The following code above it:
<style>
/* To view the year change the "none" to "block" */
#date {
display: block;
float:left;
margin: 0 5px 0px 0;
padding: 1px 15px 15px 10px;
color: #333;
background: transparent url(http://bloggertipspro.googlepages.com/Calendar.png) no-repeat;
border: 0;
text-transform: uppercase;
}.month {
margin: 0px 5px 0px 9px;
color: #fff;
display: block;
font-size: 10px;
font-weight:bold;
}.year {
margin: 0px 5px 0px 6px;
display: block;
font-size: 10px;
}.day {
margin: 5px 5px 0px 7px;
display: block;
font-size: 20px;
font-weight:bold;
}
</style>
This the CSS code, this governs the look of the calendar. If you know a little bit programming you can make modifications to this code and add your own image.
8. Search for the following code:
<body>
9. Just below the code paste the following code:
<!–date image background–>
<script>
function replace_date(d)
{
var da = d.split(' ');
month = "<div class=’month’>"+da[1].slice(0,3)+"</div>";
day = "<div class=’day’>"+da[0]+"</div>";
year = "<div class=’year’>"+da[2]+"</div>";
document.write(month+day+year);
}
</script>
<!–date image background–>
This javascript diaplays the date. You can change the order of display in document.write function.
1o. Save the template.
And now your date in calendar style is up and running.
Facing problems? Tell me!!











August 27, 2009 - 1:39 am
Awesome, thanks so much! Will use this fur sure in a template design!
August 27, 2009 - 8:47 am
thank you so much Gautam….
August 27, 2009 - 8:35 pm
oo. you mean blogger.com or blogspot..
NIce tips and I'll try at my blogspot blog
August 27, 2009 - 11:05 pm
Nice tutorial. I had my done too. Have a look at http://www.miketok.com
September 3, 2009 - 5:50 am
Hi Gautam , great little script for the calendar date – I'm trying to figure out how to display the year though – where do I have to change the script line to denote 'block' in order for the year to be displayed ? other than that : thanks a lot for the script
September 5, 2009 - 12:43 am
@Mia: Hey the year should appear if u have used the same code as above but there may be problem due to css of your blog. I prefer u try to change the font sizes so that you get the desired reults.
September 5, 2009 - 9:11 am
How can i put it in spanish?
September 6, 2009 - 6:39 pm
@brian: I think you should use spanish as your blog language and then you might see the date in spanish
September 7, 2009 - 1:04 pm
Hi Gautam , thank you for your response , I had changed the font size & everything – but it simply just refused to appear – maybe Time is really standing still for me
as you can see I am using Cheth's Template ( and that boy has so much code in there , that I fear touching or altering anything in case it just EXPLODES !
LOL – when I get up the nerve , I will attempt this again . Thank you for your response . Happy blogging G.
September 8, 2009 - 12:33 am
@Mia: Ya it becomes difficult to alter if you have little info and your template is fully loaded but you can still try by first downloading the template for backup purposes and edit the code
September 15, 2009 - 6:20 pm
Guatam – That's great, I had wondered how you setup the calendar to post as you do.
I will have to try that out on my site.
September 21, 2009 - 10:58 pm
Thanks for the tutorial!
Somehow, I can't find the first set of codes, which is:
<data:post.dateHeader/>
And then when I tried posting the 2nd set:
<div id='date'>
<script> replace_date('<data:post.dateHeader/>');
</script>
</div>
It said they had an error interpreting blog template.
Help?
Thank you.
September 21, 2009 - 11:31 pm
If you can't find the code, try to place it above <post.body> or below <post.header>. you have to try and after some trials it will be functioning properly
Recent blog:=- Win 100$ by leaving comments at TechZoomIn
October 12, 2009 - 10:40 pm
i couldn't do it as well
like carmen chan, there wasn't any
<data:post.dateHeader/>
and when i tried what you suggested it still didn't work *sigh* :'(
Recent blog:=- Shut up and Drive
October 13, 2009 - 7:49 pm
Manju if it desn't work that means either yur template doesn't have the code or either you have to paste the code just below <data:post.title>. You need to try and after a few, you would be able to add the cutom date.
October 17, 2009 - 5:57 am
Your post indirectly helped me clear a bug in my code after I'd worked around the HTML code of my blog's template a bit. That's because I could know that data:post.dateHeader is used for showing date
Thanks anyway
November 3, 2009 - 1:17 am
Please tell me how to move the entire calendar about 1 centimeter to the left (how to move left), because i have a photo blog and the first picture is pushed to the right. Please help me with this one !
November 3, 2009 - 7:55 pm
Thanks so much for this post. I had a devil of a time customizing my custom template but it finally worked! Looks just great!
November 12, 2009 - 4:28 pm
How would you make the date header to appear in multiple posts on the same day with changing the date from header to timestamp.
November 14, 2009 - 11:20 am
You will have to split it according and also difent css tags for it seperately, though i would recommend you use this hack.
November 16, 2009 - 10:58 pm
I've done as you said but it doesn't show anything
December 24, 2009 - 3:44 pm
I’m good until step 9, then I get the following error message:
We were unable to save your template
Please correct the error below, and submit your template again.
Your template could not be parsed as it is not well-formed. Please make sure all XML elements are closed properly.
XML error message: The content of elements must consist of well-formed character data or markup.
February 17, 2010 - 6:54 am
We were unable to save your template
Same response:
Please correct the error below, and submit your template again.
Your template could not be parsed as it is not well-formed. Please make sure all XML elements are closed properly.
XML error message: The content of elements must consist of well-formed character data or markup.
How do i solve this?