Painter Theme Date Customization

The WordPress Content Management System is a fabulous CMS and has a community that submits some great open source themes. The Painter Theme is one of those, created and submitted by Marcelo Mesquita in Brazil. I’ve used the theme and love it.

In the process of setting it up, I wanted to change how the date displays in the upper left hand corner. By default, the date displays in a Latin, Romance Language type format. In the States, people are used to a different date format, and being based in the States, I wanted to change how the date displays. I tweaked with the code and while my first tries created errors in the code, I figured it out.

I checked the WordPress forums to post it there, and now can’t find the proper string, then went onto the theme author’s website and tried to post it there, but the code kept getting stripped out. Here are the changes that I made. (Sorry that it runs off the page.)

Here is the original code in the header.php before modification:

<?php printf("%s, %d %s %s %s %d", __(date('l')), date('j'), __('of', 'painter'), __(date('F')), __('of', 'painter'), date('Y')); ?>

If you want the dates to be formatted American style, switch out the code above for the one below, and make sure that the code is still surrounded by the beginning and end “p” tags. Make this change in the header.php file. I modified the code so that the values continue to match up. It validates!

<?php printf("%s, %s %d, %d", __(date('l')), __(date('F')), date('j'), date('Y')); ?>

That should work.

This entry was posted in Wordpress Tweaks and tagged , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>