I'm displaying list or archives using
<?php get_archives('monthly', '', 'html', '', '', FALSE); ?>
and my list displays
December 2012 November 2012 etc
However I would like to format this to display:
12.12 11.12 10.12 etc
Any ideas?
I'm displaying list or archives using
<?php get_archives('monthly', '', 'html', '', '', FALSE); ?>
and my list displays
December 2012 November 2012 etc
However I would like to format this to display:
12.12 11.12 10.12 etc
Any ideas?
There is but the filter sucks, it only gives you the link HTML:
add_filter( 'get_archives_link', 'wpse74891_archives_link' );
function wpse74891_archives_link( $link ) {
$link = preg_replace_callback( '/>([A-Za-z]+\s+\d{4})/', function( $matches ) {
return '>' . date( 'm.y', strtotime( $matches[1] ) );
}, $link );
return $link;
}
Using this method you can pass in any date format you want for the link at least.
Try changing the date display format under Settings > General in your WordPress admin. Choose the custom option and enter y.m
into the box.
If you're feeling adventurous, there are lots of other formatting tags available
get_archives
has been deprecated and replaced withwp_get_archives
– jzatt Dec 4 '12 at 11:09