Free Wordpress Blog Setup

How to Create a Customized Date Button for WordPress

By Editorial Staff in Tutorials
How to Create a Customized Date Button for WordPress

When making your blog stand out, one thing that bloggers often ignore is the date button. Something as simple as a customized date button can really make a difference in your blog’s design. Therefore in this article we will show you how you can create a customized date button for WordPress.

Custom Date Button for WordPress

We will start out from the image shown in the left, and will make it look like the one in the right.

You can use the image that we are using above if you so desire for your use, or create your own one.

First thing you need to do is open your style.css file and add something like below:

.datebg{
background: url(images/datebg.gif) no-repeat;
height: 173px;
width: 173px;
}
.day{
}
.month{
}

Now you may style it however you like, and you can also change the name of the class. Then you would need to open your index.php and single.php. And add the following code where your template fits.

<div class="datebg">
<div class="month"><?php the_time(’M’) ?></div>
<div class="day"><?php the_time(’d’) ?></div>
</div>

Make sure you change the styling to fit your needs. Now you should have a customized date image. You can also refer to WordPress Codex for more information.

What Next?

Digg it
Save This Page
Subscribe to WPBeginner
Stumble it
Free Wordpress Blog Setup

Comments

2 Responses to “How to Create a Customized Date Button for WordPress”
  1. Allen Varney says:

    The custom button looks like nothing but a patch of overlapping gray rectangles in Firefox 3.0.11. I had to look at the page in IE to see what you meant. Perhaps we need a blog entry on checking your CSS in different browsers.

    • If you just copied and pasted the codes, then you obviously didn’t read the article. No where in there, we have set the paddings, margins, or any other styling. The ones there were just basis. No styling was done. But if you mean that our site is having issues in browsers, please send us a screenshot last time we checked, this site was cross-browser compatible.

Share Your Opinions

Tell us what you're thinking...
and if you want a pic to show with your comment, then get gravatar!

Please make sure that you have read our Comment Policy.

Due to high volume of request from our readers, we are adding this feature that allows you to stay updated with this post's comments without having to participate in the discussion even though we would love your input as always. Don't worry we hate SPAM just as much as you do, so you will never receive any SPAM messages from our site and that's our promise to you.

Subscribe without commenting

Close Bar