Last active
December 17, 2015 11:29
-
-
Save GaryJones/5602296 to your computer and use it in GitHub Desktop.
Amended post date styling, including the year
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'genesis_post_date_shortcode', 'child_post_date_shortcode', 10, 2 ); | |
/** | |
* Customize Post Date format and add extra markup for CSS targeting. | |
* | |
* Includes the year as well. | |
* | |
* @author Gary Jones | |
* @link http://code.garyjones.co.uk/style-post-info/ | |
* | |
* @param string $output Current HTML markup. | |
* @param array $atts Attributes. | |
* | |
* @return string HTML markup. | |
*/ | |
function child_post_date_shortcode( $output, $atts ) { | |
return sprintf( | |
'<span class="date time published" title="%4$s">%1$s<span class="day">%2$s</span> <span class="month">%3$s</span> <span class="month">%5$s</span></span>', | |
$atts['label'], | |
get_the_time( 'j' ), | |
get_the_time( 'M' ), | |
get_the_time( 'Y-m-d\TH:i:sO' ), | |
get_the_time( 'Y' ) | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The last
class="month"
should beclass="year"
if I'm not mistaken :)