Customized Wordpress Date Button
When I created a custom date button on Zain’s Blog people really liked it. It was a well planned out design. Then I thought it would make a great post if I show you guys how to make a Customized Wordpress Date Button.
Why should you get a customized date button? Simple. It looks cool. It goes with some themes and doesn’t go with others. I think it just spice up some themes if used correctly. For this tutorial: I am assuming you can make your own graphics, if you are not using mine. You have little knowledge of html and css (I mean you know how the div tags and padding works). The final outcome of this tutorial should look like the image on your right.
This is a 3 step tutorial. First we will add the day of the month, then we will add the month, and then finally it will be the year.
We will be using the following image as our background:

First thing you want to do is make a class in your css file that is called .datebg and set your background image.
.datebg{
background: url(images/datebg.gif) no-repeat;
height: 150px;
width: 150px;
}
Than insert it in the appropriate wordpress file. Hint: index.php, single.php…
So right now your codes should be looking like this:
<div class="datebg">
</div>
Now you need to add another class and call it .day and set the appropriate margin and CSS. Choose your color and font-size. Insert that class inside your datebg class.
Within your .day class insert the following codes: <?php the_time(’d') ?>
This will allow you to display the date, so like today is the 22nd so thats what it will show you.

Now you need to go ahead and add another class in your css file and name it .month and add the appropriate margin and padding to it. Insert it right after your .day class in the template files.
Within this class you need to add: <?php the_time(’M') ?>
This will display the month of the year like in the picture shown below:

Then you will need to make another class and name it .year. Set the appropriate padding and margins. Insert it right after your month class.
Then within this class add the following codes: <?php the_time(’Y') ?>
This will display the year.

So in the end your template files should look like this:
<div class="datebg">
<div class="day"><?php the_time(’d') ?></div>
<div class="month"><?php the_time(’M') ?></div>
<div class="year"><?php the_time(’Y') ?></div>
</div>
Now you have your own customized wordpress date button. Feel free to use my image in this post. I made it 150 x 150px so people can make it smaller and not lose quality. If you are just wondering how the heck do I enter plain simple date like Balkhis have.
Then just plain enter <?php the_time(’M j, Y’) ?>
This will give you an outcome like Aug 22, 2008.
Enjoy.
Note: Do not copy and paste codes. Type it down by looking at these.




















Hey, I am Syed Balkhi, The guy who is behind Balkhis Inc. I entered the industry back in 2002 not knowing a single thing. I barely spoke English at that time. In the past six years, my language barrier has been eliminated. Aside from English, now I also speak html, and php. Along with the languages I have also managed to master a few arts. Art of web-designing started when I first entered. Messing around with photoshop, I learned how to create my first web design. Now I founded a web designing firm Uzzz Productions. After running numerous amount of websites in various niche, I have mastered the art of web-development. Now I am compiling a resource of what I already know, and what I am learning on this blog. This resource is to help me if I ever need a guide to look back to, and it is help my fellow webmasters.




Great tip! Easily explained, so even someone with my lack of experience can understand.
Thats a great tutorial which I’m probably going to have to use sometime soon for a special project of mine. I actually needed some help implementing my email subscription code so maybe you can do a tutorial on that because im stranded!
Sure Nabil… I will do my best in writing one down.
I like it, I don’t have the talent to make my own, but I like it.
Yet another useful design tips. Great tutorial! Looks like your Digg shout is pretty effective, huh?
Yan
Yan, Digg is a good source of traffic. But social media is much better.
This is an awesome tutorial. I was actually just thinking about doing this myself but I guess you got it posted first. It will be easier for me just to recommend your post to my readers. Thanks a lot.
hehe yup feel free to link to me
I always like that
The Date button looks awesome!! I specially love the drop shadow behind it.
Yeah it was pretty simple to create that gradient style in photoshop.
Nice! But I sort of already like the custom date that comes with my theme (I modified it a bit)
oo yeah it is not for people who already have it. This is just a tutorial that shows how it can be done.
I like it because allows me to see how some of the code works.
yup that is the whole point of this one
The Date Button looks awesome! I especially love the drop shadow behind it. Nice work Syed.
Hey, I need one of those for my blog - I will get one going soon - thanks
OMG, this is perfect, I was searching everywhere for this information for a while, since my date button on my blog is not that great. THANKS!!!!!!!