Lower Case Months Plugin for WordPress

This WP plugin is kind of pointless, since you can modify text capitalization via the CSS text-transform property: lowercase, capitalize and uppercase are all options. more info

Wordpress plugin 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().



Jon Raasch

Jon Raasch is a UX nerd and free-lance web designer / developer who loves jQuery, Javascript & CSS.




You Might Also Like:


9 Comments to “Lower Case Months Plugin for WordPress”

  1. Alec Resnick says:

    Awesome; exactly what I was looking for. . .Except, broken link? Just an empty file downloads.

  2. Jon Raasch says:

    Hey Alec,

    Sorry about that, the download link should be working now.

    -jr

  3. cnk says:

    Thanks so much, this is great and should be included with wp.

  4. Jussi says:

    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…

  5. dave says:

    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

  6. Livia says:

    Thanks, this is awesome. It was driving me crazy trying to get it to work!

  7. Livia says:

    Actually, I just realized you can do this through the CSS (text-transform: lowercase; ).

  8. Jon Raasch says:

    Hey Livia, yeah much better to just use CSS text-transform for this, I have been meaning to post on that.

    For reference see here:
    http://www.eskimo.com/~bloo/indexdot/css/properties/text/texttrans.htm

    -jr

  9. bob says:

    I downloaded your plugin and it works perfectly. I also made changes to my style sheet as you recommend. But one thing I can’t get to work. The calendar displays the title in lower case, but the previous month or next month (links) display in mixed case and I’d like to get them to display only in lowercase. I just can’t figure out where I would make the change. Any suggestions?

    bob


Comments are closed.