Lower Case Months Plugin for WordPress
While doing some WordPress customization recently, I ran into a problem forcing lower case output for the month headers in my blog archives.
It seems like a simple task but it turns out the WordPress templating engine prevents you from returning any strings from functions while within a template. You can use all the PHP you want, and call any function you want, but the functions in the end work by echo’ing out a result, rather than returning it. This seems like a pretty good security move, but it turns out to be pretty annoying when you’re used to object oriented code and you want to do something simple like make an outputted date string into lower case.
So I made a simple plugin to make lowercase months and days in WordPress (e.g. “saturday march 15th”).
I also added strtoupper and ucwords to the plugin, as well as functions for the_title(), the_content(), the_category() and the_tags(). It’s named cASe iNSenSITivE .
Download cASe iNSenSITivE plugin
Its a plugin so upload it to your wp-content/plugins directory and activate it within admin > plugins.
To call a function, use an underscore followed by whichever PHP string function you want to use, for example the_time_strtolower() or the_title_ucwords().
Posted on Thursday, March 13th, 2008 at 6:49 pm in webdev.
Tags: blog, customization, downloads, object oriented, open source, PHP, template, wordpressRSS 2.0 | Trackback |






March 31st, 2008 at 3:51 pm
Awesome; exactly what I was looking for. . .Except, broken link? Just an empty file downloads.
March 31st, 2008 at 4:49 pm
Hey Alec,
Sorry about that, the download link should be working now.
-jr
August 10th, 2008 at 12:37 am
Thanks so much, this is great and should be included with wp.
August 28th, 2008 at 3:41 am
Hi!
Great plugin and much needed in Finland…Thank you!
But should it work with comment_date_strtolower? That’s the only date I have left to change into lowercase and it just doesn’t work…
September 23rd, 2008 at 4:25 pm
what do you edit to get this to work in the month section of the archives for wordpress? i have been trying different things and each one either does not work, or it breaks the page. please help