Not sure how to do this so I thought I'd post it here. The following code: <?php get_archives('monthly', '', 'html', '', '', TRUE); ?> Is displaying archives like: September 2008 (1) How can I have it just show something like: September '08 (1) Thanks in advance..
Not sure ya can....but I do know that function is deprecated. Here's a link to the new one with all the options: http://codex.wordpress.org/Template_Tags/wp_get_archives
It should. The parameters seem to be identical. Plus when Wordpress finally removes the deprecated function from the core, your site will not be affected by it when you upgrade. As for your question, there is no way to accomplish this without editting that core function itself. You could however create your own function and put it into your theme's functions.php file. Copy the wp_get_archives function from the general-template.php core file in its entirety, paste into the theme function file, and give it a new name (ie my_get_archives). Find this code in the new function: $text = sprintf(__('%1$s %2$d'), wp_locale->get_month($arcresult->month), $arcresult->year); Code (markup): Replace it with this code (major changes hilited in red): $text = sprintf(__('%1$s [COLOR="Red"]’%2$s[/COLOR]'), wp_locale->get_month($arcresult->month), [COLOR="Red"]substr(strval($arcresult->year),2)[/COLOR]); Code (markup): Don't forget to change your original template function call: <?php my_get_archives('monthly', '', 'html', '', '', TRUE); ?> Code (markup):
Yeah but if you start messing with core functions for something so trivial (sorry if I'm downplaying it) then it will be a pain when it comes time to upgrade Wordpress...I'd say leave it, and stop being such a perfectionist (I say that with luv)
@Dodger, sweet thanks. +rep to you. I made those changes and it shows it as: September ’08 Which is right, but it's missing the (1) now... so it should be like this: September ’08 (1) Any ideas?
That code did not mess with the core function. It created a new function for the theme, which people do all the time for extra functionality. If he changes to another theme on down the line, then the function will have to be re-inserted into that themes functions.php file. I also know of people changing the core to remove Nofollow, rather than install another plugin. To each their own I guess. Some people just like to tinker with this stuff. @MakeThat Dollar: Did you change the code to false or leave it null? <?php my_get_archives('monthly', '', 'html', '', '', [B][COLOR="Red"]TRUE[/COLOR][/B]); ?> Code (markup):