Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if ( ! function_exists( 'aa_entrymeta' ) ) :
- /**
- * Prints HTML with meta information for the current post-date/time and author. If post was updated, it also prints
- * the date of the update.
- */
- function aa_entrymeta() {
- $time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>';
- $update_time_string = '<time class="updated" datetime="%s">%s</time>';
- $time_string = sprintf( $time_string,
- esc_attr( get_the_date( 'c' ) ),
- esc_html( get_the_date() )
- );
- $posted_on = sprintf(
- _x( 'Posted on %s', 'post date', 'codeaurooba' ),
- '<a href="' . esc_url( get_permalink() ) . '" rel="bookmark">' . $time_string . '</a>'
- );
- $byline = sprintf(
- _x( 'by %s', 'post author', 'codeaurooba' ),
- '<span class="author vcard"><a class="url fn n" href="' . esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ) . '">' . esc_html( get_the_author() ) . '</a></span>'
- );
- if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) {
- $update_time_string = sprintf( $update_time_string,
- esc_attr( get_the_modified_date( 'c' ) ),
- esc_html( get_the_modified_date() )
- );
- $updated_on = sprintf(
- _x( 'Updated on %s', 'updated date', 'codeaurooba' ),
- '<a href="' . esc_url( get_permalink() ) . '" rel="bookmark">' . $update_time_string . '</a>'
- );
- echo '<span class="posted-on">' . $posted_on . '</span><span class="updated-on">' . $updated_on .'</span><span class="byline">' . $byline . '</span>';
- } else {
- echo '<span class="posted-on">' . $posted_on . '</span><span class="byline">' . $byline . '</span>';
- }
- }
- endif;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement