I want to make a custom entry_date function based on the one found in twenty-thirteen. I just want to have the day, the month and the year in separate <span>
s
I don't understand why what I want to achieve will not work.
The date is printed but not inside the <a href="">
tag.
What am I doing wrong?
My code is:
$date = sprintf( '<span class="date"><a href="%1$s" title="%2$s" rel="bookmark"><time class="entry-date" datetime="%3$s"><span class="date--day">%4$s</span><span class="date--month">%5$s</span><span class="date--year">%6$s</span></time></a></span>',
esc_url( get_permalink() ),
esc_attr( sprintf( __( 'Permalink to %s', 'lyod' ), the_title_attribute( 'echo=0' ) ) ),
esc_attr( get_the_date( 'c' ) ),
esc_attr( the_time(d)),
esc_attr( the_time(M)),
esc_attr( the_time(Y))
);
For the record, here is Twenty-Thirteen function:
$date = sprintf( '<span class="date"><a href="%1$s" title="%2$s" rel="bookmark"><time class="entry-date" datetime="%3$s">%4$s</time></a></span>',
esc_url( get_permalink() ),
esc_attr( sprintf( __( 'Permalink to %s', 'twentythirteen' ), the_title_attribute( 'echo=0' ) ) ),
esc_attr( get_the_date( 'c' ) ),
esc_html( sprintf( $format_prefix, get_post_format_string( get_post_format() ), get_the_date() ) )
);
Thank you in advance for the help!