function woodmart_post_date( $args ) { $has_title = get_the_title() != ''; $attr = ''; if ( ! $has_title && ! is_single() ) { $url = get_the_permalink(); $attr = 'window.location=\'' . $url . '\';'; } $classes = ''; $classes .= ' ' . $args['style']; $classes .= woodmart_get_old_classes( ' woodmart-post-date' ); ?> <div class="post-date wd-post-date<?php echo esc_attr( $classes ); ?>" onclick="<?php echo esc_attr( $attr ); ?>"> <span class="post-date-day"> <?php echo get_the_time( 'd' ); ?> </span> <span class="post-date-month"> <?php echo get_the_time( 'M' ); ?> </span> <span class="post-date-year"> <?php echo get_the_time( 'Y' ); ?> </span> </div> <?php }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter