Wednesday, June 17, 2009

How To Show The Post Date On Every Post

From this tutorial, you will be able to show the post date on every last one of your posts. As we all know, Blogger’s default templates only show a single date for every post that was posted that day. Some readers will find it convenient to have that quick glance at the date on each post, but some will not even notice. This tutorial is definitely handy if you plan to use a calendar icon as your post date, since the timestamp can be modified. As always, make sure you download your current 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. Now search for the red line of code or similar code:

Note: If you can’t seem to find the line in red, try the second section code in blue.

<div class='post-feeds'>
<b:loop values='data:posts' var='post'>
<b:if cond='data:post.dateHeader'>
<h2 class='date-header'>
<data:post.dateHeader/>
</h2> </b:if>
<b:include data='post' name='post'/>

4. Next, replace the section code above in green with the section code below:

<div class='date-header'>
<data:post.timestamp/>
</div>

5. Preview, and if all looks good, Save Template.

Note: You can modify your timestamp by clicking on the settings tab > formatting. Change the setting under timestamp format to your desired option.

6 comments:

  1. This is very useful but I have a huge problem.
    My code does not look like this and i really Suck at html/xhtml.
    Could you please please help me figure it out?

    This is my code:

    <> replaced by ()

    (b:includable id='post' var='post')

    (div class='post uncustomized-post-template')

    (div class='title')
    (a expr:name='data:post.id'/)
    (b:if cond='data:post.title')
    (div class='date')(span) (b:if cond='data:post.dateHeader')
    (data:post.dateHeader/)
    (/b:if) (/span)(/div)
    (h2 class='title')
    (b:if cond='data:post.link')
    (a expr:href='data:post.link')(data:post.title/)(/a)
    (b:else/)
    (b:if cond='data:post.url')
    (a expr:href='data:post.url')(data:post.title/)(/a)
    (b:else/)
    (data:post.title/)
    (/b:if)
    (/b:if)
    (/h2)

    Please help me!

    ReplyDelete
  2. Hey Oz, I would be glad to help you out, but as always make sure you download your current existing template just in case it doesn’t turn out as expected.

    ***<> replaced by ()

    Replace the section code below:

    (div class='date')(span) (b:if cond='data:post.dateHeader')
    (data:post.dateHeader/)
    (/b:if) (/span)(/div)

    with this:

    (div class='date')
    (data:post.timestamp/)
    (/div)

    Preview, and if all looks fine, Save.

    Note: If your date is now appearing twice, you need to search for the section code below and make sure it doesn't appear twice on your coding, if it does delete the duplicate copy(not the one you just added):

    (data:post.timestamp/)

    Because this is a timestamp rather then the actual date header itself. Since Blogger can't display the date header in every post, the timestamp is, so becareful not to have duplicate timestamp section code in your template.

    ReplyDelete
  3. Thanks for posting this, I was getting so annoyed with it, and couldn't find any other way to show the actual date on every post!

    ReplyDelete
  4. your welcome procrastistamper, haha i was just there, so its only right to share it with others

    ReplyDelete
  5. Could you please help me as well. I just created my blog from a template and I don't have "dateHeader" anywhere.

    You can see the code at www.favredollarfootlongs.com

    I would be greatly appreciated.

    Thanks

    ReplyDelete
  6. hey gene, your post header is appeared as:

    < div class='date' >

    ReplyDelete