In your index.php file, there is the following line (if you haven’t changed it; this is the out-of-the-box version of index.php):
<?php the_date('','<h2>','</h2>'); ?>
That will create the following HTML for you:
<h2>Saturday 5th June 2004</h2>
In your style sheet, you can modify the settings for the h2
, or you can change the the_date() call in your index.php to add a span that you can modify in your style sheet. To add a span in your index.php, just replace the code above with:
<?php the_date(",'<h2><span>','</span></h2>'); ?>
I can’t think of a way without hacking the code.
yes, im aware of <span>
within <h2>
around the date – just not on a specific portion of the date – maybe some enterprising WP plugin writer would be kind enough 😉
i did have a look at the the_date
function, but i couldnt see how to alter it.
I suspect you would have to write something to filter the date through – a bit much I would think.
Do you still want the date to only appear once for each day? If you don’t mind it appearing for each post, you could use the_time instead, calling it twice each time. Once for the day of the week which you could style and then once for the rest of the date.
http://wiki.wordpress.org/the_time
http://wiki.wordpress.org/the_date
Anonymous
yeah, separate calls are the way to go. just feed the relevant parameters into the function calls as per the wiki.
Good idea Oisin…I never thought of passing the “span” through to the_date function. Pretty slick!