Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function presscore_get_post_fancy_date( $new_class = '' ) {
- if ( !in_the_loop() ) {
- return '';
- }
- $class = 'fancy-date' . ( $new_class ? ' ' . trim($new_class) : '' );
- $href = 'javascript:void(0);';
- if ( 'post' == get_post_type() ) {
- // remove link if in date archive
- if ( !(is_day() && is_month() && is_year()) ) {
- $href = presscore_get_post_day_link();
- }
- }
- return sprintf(
- '<div class="%s"><a title="%s" href="%s" rel="nofollow"><span class="entry-month">%s</span><span class="entry-date updated">%s</span><span class="entry-year">%s</span></a></div>',
- esc_attr( $class ), // class
- esc_attr( get_the_time() ), // title
- $href, // href
- esc_html( get_the_date( 'Y' ) ), // year
- esc_html( get_the_date( 'j' ) ), // date
- esc_attr( get_the_date( 'M' ) ) // month
- );
- }
Add Comment
Please, Sign In to add comment