WordPress Date Button

I don’t know what’s up with the date button, but you seem to really love it. Yea, you! Today, we’re going to learn how to create a date button for WordPress. Here it is in the three simple steps:

date button

First – Type the code

(Do not copy and paste. Type it out.)

<div class=”post-date”>
<div class=”month”><?php the_time(‘M’) ?></div>
<div class=”day”><?php the_time(‘d’) ?></div>
</div>

For organization sakes, here’s how it should look like in your source codes:

date_button_codes.gif

What the codes actually mean:

<div class=”post-date”> – I’m starting a box or DIV named “post-date.” I could’ve named it “little-potato.”

<div class=”post-month”> – Within the post-date box, I’m starting another box for the month.

<?php the_time(‘M’) ?> – Here’s where I use the PHP function the_time(‘M’), to call for the abbreviated month name. For example: JUN for June. On my date button example, it’s JUNE instead of JUN because I haven’t coded it to call for the abbreviated version.

</div> – The month box ends here.

<div class=”day”> – The day box starts here.

<?php the_time(‘d’) ?> – Using the PHP function the_time(‘d’), I’m calling for the day number, which will be a two-digit number. For example: 03.

</div> – The day box ends here.

</div> – There’s nothing else to add to my date button so I’ll end the post-date box or DIV here too because I have to close everything in the order that I open them.

(For more display options for the date, go to php.net.)

Second – Create the background image

You’ll need some kind of design software, like Photoshop, to design your date button background image. Here’s my date button background image:

date_button_template.gif

Third – Style it

This step requires you to know a little bit about CSS and it depends on personal preference because your background image will be different from mine. But, here is the basic:

.post-date{
float: left;
display: inline;
margin: 0 10px 0 0;
background: url(images/date_button_template.gif) no-repeat;
}

date_button_template.gif should be the name of your image. images/ is the location of the image folder. If you store your images in a different folder, change images/ to match the location of your image folder.

The Pride theme, which includes the use of a date button, will be released soon.

What's Next?

Very nice, SP. Glad to see another theme tutorial. :)

Nice tutorial.

I’ll write some more tutorials soon. Don’t forget the upcoming downloadable wordpress theme tutorial. I’ll try to finish that within this month, but I have a lot going on.

seo-sem:

very nice tutorial.
can u share button psd file

Hello Seo-sem,
It’s so easy to create that kind of button. Just create one rectangle with rounded corners and copy it, apply desired color, by adding selecting the points you can also create a little arrow at bottom as shown, or use a creative alternative. And you will be done with it. I will give a try right now, like to learn by myself. ATB

seo-sem:

Thanks Web king,
thanks for your tips,but the problem is that i am a very begineer in photoshop and this button is what i always wanted and needed.So i asked small potato to share if he can.
I tried many times to make this type of button but could not succeed.

Cheers for this, I tried to add something akin to this in my adaptation of the theme I am using at the moment but I couldn’t quite figure out what needed to be changed. I will give it a try this weekend. :-)

@Seo-Sem – Remind me when the Pride is finished. I’ll send you a copy of the psd.

seo-sem:

@Small Potato-Thanks will definetely remind you.
BTW: I loved you blog very much,great blog indeed

Cool. Will try this soon.

nice tutorial! i will definitely incorporate this one to my themes.

great tutorial! let me try this one.

Thanks! I need date icon, see if I can do this tuts.

Very Nice tutorial!

[...] Son fotos del momento antes de que ocurriera un accidente. [Via El bloggeo] – La fecha – Aca les dejo un tutorial de como hacer una imagen de fecha para que aparezca en todos sus posts [...]

[...] For more explanation go to: wpdesigner.com [...]

[...] the design includes a date button? Date buttons are eye candies. Theme users really love [...]

you read my mind, or I read yours… I knew that I wanted a date button when I went to make a new theme. So I put one in. I wish I had seen this tutorial. I took your other 16 lesson tutorial though.

Say, uh.. you know what many date button designers forget to do? Add the YEAR in somewhere.. the year does not have to be in the button. I added the year in another area.
http://heartdaughter.com/blogs/elijah/

I am very fussy about the date being prominent at the beginning of a blog entry. I want to read FRESH SCHTUFF!

nada

Under every post title I have the number of the post: “Post No. xxxx” At some point I’d like to show this number graphically, with a medaillon type bug. Can I follow the same procedure shown here?

There’s no reason to you can’t rearrange it to work like a date buton.

Hey that was Kool !!!!

Simple, consice but complete.

Brett:

May be a stupid question, but how do I make the abbreviated Month appear in UPPERCASE?

text-transform: uppercase;

Hi

Great tutorial!

Im new to designing my own themes, where excatly and which files do I need to add the code?

I’ve been doing all your tutorials – THANKS. I, too, love the date button and searched for a template that used it. NOW that I can build my own templates, thanks for showing me how easy the date button is.

[...] adding something like this to your theme, Small Potato has a great write up explaining how to add a WordPress date button. The only step that requires a little bit of thought is getting an icon to use for the background [...]

[...] 设计是否包含有日期块? 日期块(英文)是个养眼的东西,主题用户非常喜欢它。 [...]

Ooh, I clicked this to see what it was, and I am very glad I did, I must use this soon!

I personally would suggest using span tags as opposed to div ones – at least to surround the number and month individually – because having the date spread across multiple lines will look silly with CSS turned off. It’s overall more semantically correct.

Thanks for sharing though – this article is most certainly one for the bookmarks!

[...] Botão para data. Faz com que a data seja mostrada dentro de um botão, mas usando apenas texto. [...]

[...] Botão para data. Faz com que a data seja mostrada dentro de um botão, mas usando apenas texto. [...]

[...] first site I found was WPDesigner and they had a good tutorial on creating the date buttons.  It wasn’t quite what I was [...]

Hello,
Thank you in advance!!

My page: http://sunruby.com/make-friends/
Where exactly do I insert that code so that the icon is right to the left of the post heading?

Joseph – Sorry I edited your comment to remove the codes, but this is not where you should ask for support of tips. Please head to the forums.

Generally, css goes anywhere you like. As for xhtml and php, place it wherever you want it to show up.

Thanks a lot, dude… I was fretting over this issue for a long time. I finally got it. But somehow, the settings seems to have screwed up my layout… I have to debug that now… But still, thanks a lot. :)

ALDRINV:

which file am I going to place the codes? (sorry newbie here) ;p

Very nice small potato. I like it.

Aldrinv – This tutorial is not for newbies.

[...] WordPress Date Button (Source: WP [...]

[...] WordPress Date Button (Source: WP [...]

[...] WordPress Date Button (Source: WP [...]

[...] Related Tutorials: CSS Date Blocks for Blogs Creating a Blog Entry Date Calendar Icon Look with CSS Coding a Date Icon with xhtml and css. Web 2.0 Date Icons For Your Blog Create a ‘Calendar style’ WordPress date format WordPress Date Button [...]

[...] WordPress Date Button (Source: WP [...]

[...] ????WP??????????????????????????????????????????????????????????WPdesigner.com?????? [...]

Very cool tutorial!

Andy:

Hi Guys,
we are running an “Article Writing Contest”
$600 worth prizes to give away.
Please check the link below to participate in the contest …

http://blogs.qualitybusinesslinks.com/

Just 1 article and you can win $$$
We hope to see your article entries soon ..
Good Luck.
-Andy

Great, exactly what I seaarched…

[...] ????WP??????????????????????????????????????????????????????????WPdesigner.com?????? [...]

[...] ????WP??????????????????????????????????????????????????????????WPdesigner.com?????? [...]

[...] adding something like this to your theme, Small Potato has a great write up explaining how to add a WordPress date button. The only step that requires a little bit of thought is getting an icon to use for the background [...]

[...] of WordPress and even PHP. The entire process of creating nifty WordPress date buttons is explained in this blog post. Technorati Tags: wordpress, date format, wordpress date [...]

[...] es sehr gute Tutorials, wie man die Date-Badge auch in dem eigenen Weblog unterbringt. So z.B. das Tutorial auf WPDesigner, nach dem ich hier gearbeitet [...]

[...] Create really cool WordPress date button [...]

[...] Create really cool WordPress date button [...]

[...] 10?????? [...]

[...] 10?????? [...]

[...] 10?????? [...]

[...] 10?????? [...]

[...] 10?????? [...]

[...] 10?????? [...]

[...] WordPress Date Button (tags: wordpress) [...]

[...] 10?????? [...]

[...] 10.????????? [...]

[...] 10?????? [...]

[...] Create really cool WordPress date button [...]

[...] Crear un bonito botón para mostrar la fecha en WordPress, ver cómo. [...]

[...] 10?????? [...]

[...] Crea fechas elegantes ( Pon un calendario a tu WordPress) [...]

[...] ????????? ? ????????????? ???? ????? ? WordPress [...]

[...] Pura estética y puro gimp. |enlace| [...]

whay we cannot copy paste? why we should type it. what the different

thanks for the tip, excellent tutorial!

[...] 10. Crear botones de fecha muy chulos para WordPress [...]

[...] Create really cool WordPress date button [...]

[...] Crear un bonito botón para mostrar la fecha en WordPress, ver cómo. [...]

[...] Crea fechas elegantes ( Pon un calendario a tu WordPress) [...]

[...] Crear un bonito botón para mostrar la fecha en WordPress, ver cómo. [...]

[...] 10?????? [...]

[...] Crear un bonito botón para mostrar la fecha en WordPress, ver cómo. [...]

[...] Crear un bonito botón para mostrar la fecha en WordPress, ver cómo. [...]

[...] 43. WordPress Date Button [...]

[...] 10?????? [...]

enettyideoppy:

tests time mashine

[...] 10?????? [...]

[...] 10????? [...]

[...] Botão de data do WordPress (Fonte: WP [...]

[...] 10?????? [...]

[...] Crear un bonito botón para mostrar la fecha en WordPress, ver cómo. [...]

[...] Create really cool WordPress date button [...]

[...] Crea fechas elegantes ( Pon un calendario a tu WordPress) [...]

very useful tutorial. i will try it

[...] Crear un bonito botón para mostrar la fecha en WordPress, ver cómo. [...]

nice tutorial

[...] 10. Create really cool WordPress date button [...]

???????? ?????.

?WP???????????? WordPress ????

?????WordPress Date Button
WordPress ????40+??????????
????hitigon
??????????????
????????????????????????????????…

[...] di creare bottoni data particolari, una rapida ricerca è trovo il tutorial di wpdesigner: WordPress Date Button. Probabilmente conoscete già wpdesigner in quanto ha prodotto una cinquantina di temi di WordPress [...]

[...] 17. Making a Brilliant Date Button Make a brilliant date button for your blog… change all sorts of things so it matches your theme too! Homepage [...]

great tutorial! let me try this one. thanks…

Alle:

Hey I’ve made the code and the button but I am unsure on where to put the code in the theme?

[...] 10?????? [...]

[...] WordPress Date Button ( Sursa: WP [...]

?????? ????????

[...] 10?????? [...]

WOW that is cool, what i needed!

[...] ??????? ????????? ?????? ??????? [...]

easy and clear that what i like you for

ohh.Nice post thaks..

[...] Crea fechas elegantes ( Pon un calendario a tu WordPress) [...]

[...] Crea fechas elegantes ( Pon un calendario a tu WordPress) [...]

[...] 10?????? [...]

[...] 10. Create really cool WordPress date button [...]

[...] 10. Create really cool WordPress date button [...]

[...] WordPress Date Button Posted on 06.27.2008 to CSS Subscribe to comments Comment | Trackback |  SHARETHIS.addEntry({ title: “Useful CSS related links”, url: “http://www.mikkolehtinen.com/css/useful-css-related-links/” }); [...]

I believe putting wordpress date button is just for decoration only.

nice work…

yaa, date button is important in blog. I studied to create it.

Thanks

Thanks

????? ?????????? ??????!

Real handy. 3 nice and easy steps of coding.

[...] Blog. 124. Huge Compilation of WordPress Code. 125. 4 Simple ways to Speed up WordPress. 126. WordPress Date Button. (Source: WP Designer. 127. Wicked WordPress Archives in One Easy Step! . 128. Make Yourself [...]

[...] Crear un bonito botón para mostrar la fecha en WordPress, ver cómo. [...]

Create really cool WordPress date button

[...] WordPress Date Button [...]

Nice tutorial. I love the fact that it is nice and sweet and right to the point.
THanks

It took me a while to find this tutorial – I wasn’t quite sure what to search for and I finally found you. Isn’t there any kind of plug-in that can do this or does it need to be custom coded?

And are the numbers on the button text or images?

[...] 10?????? [...]

Thank you for this tutorial, it was useful for me in my blog

Jane, I have seen you blog, good luck with it! Please check my one and give your idea what to do next?
http://bodrum.turkeytravelinfo.net

[...] Blog. 124. Huge Compilation of WordPress Code. 125. 4 Simple ways to Speed up WordPress. 126. WordPress Date Button. (Source: WP Designer. 127. Wicked WordPress Archives in One Easy Step! . 128. Make Yourself [...]

[...] 10?????? [...]

[...] 10?????? [...]

[...] Blog. 124. Huge Compilation of WordPress Code. 125. 4 Simple ways to Speed up WordPress. 126. WordPress Date Button. (Source: WP Designer. 127. Wicked WordPress Archives in One Easy Step! . 128. Make Yourself [...]

[...] Create really cool WordPress date button [...]

Andres:

Hi: Do you know any plugin or any way to search post by category and date showing a calendar, like this:
http://www.elmostrador.cl/index.php?/noticias/legales/

Thanks.

This is quite handy, thanks for the information!!

[...] trying to figure how to work this. I want to create a calendar background for my posts like here: WPDesigner WordPress Date Button Since I can’t edit the php directly, I tried using Thesis hooks. I created a custom [...]

Excellent site! I wish the owner to develop and please all! http://sex-free-online.ru/map.html

It is not out-of-date information? Because I have other data on this theme. http://video-online-go.ru/map.html

[...] ????WP??????????????????????????????????????????????????????????WPdesigner.com?????? [...]

This is an excellent tutorial. I found it very interestintg and understandable…..which is a big deal because I’m relatively new to wordpress. I plan to use customized post dating on my next blog about Sleep Apnea Pillow. I will be returing to this page for more knowledge and wisdom soon. Thanks SP!

I have been trying to apply it on my blog Turkey but can not…

[...] ????WP??????????????????????????????????????????????????????????WPdesigner.com?????? ??? – ??? (??COPY?????????????) [...]

[...] 10.??????????????? [...]

[...] 10.??????????????? ???????????????????? [...]

[...] 10.??????????????? [...]

So simple. I’m starting to understand how easy WordPress is to customise – all you need to know is the simple tag and a bit of HTML and Bob’s your Uncle!

Thanks

[...] 10.??????????????? [...]

Yvj8h5 hi! how you doin?

Superb article friend!!!!!

I like this article!!!!! :-)

Friend your articles are mind blowing!!!!! :-)

Excellent article friend!!! keep it up!!

I read many of your posts!!!!!!!!!!! its excellent

does it make cpu problem?

[...] 36. WordPress Date Button (Source: WP Designer) [...]

great tutorial!

Thanks!

[...] 10.??????????????? [...]

kookimebux:

Hello. And Bye. :)

[...] 10.??????????????? [...]

[...] Create really cool WordPress date button [...]

[...] Blog. 124. Huge Compilation of WordPress Code. 125. 4 Simple ways to Speed up WordPress. 126. WordPress Date Button. (Source: WP Designer. 127. Wicked WordPress Archives in One Easy Step! . 128. Make Yourself [...]

[...] Create really cool WordPress date button [...]

[...] Blog. 124. Huge Compilation of WordPress Code. 125. 4 Simple ways to Speed up WordPress. 126. WordPress Date Button. (Source: WP Designer. 127. Wicked WordPress Archives in One Easy Step! . 128. Make Yourself [...]

[...] WordPress Date Button (Source: WP [...]

[...] 10.??????????????????????????????????? [...]

[...] ?????WordPress Date Button [...]

????????????,????,????,??????,????,??????,????,????,3G??,CDMA???.

gr8!!

nice!!

date button??

word press date button works

date button is important!!

clever work!!

wow.. cool.. I will implement this to my theme..

simple yet an coll for wordpress.. needless for the calendar widget..