Advertisement
Guest User

Untitled

a guest
Jun 3rd, 2015
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.62 KB | None | 0 0
  1. if ( ! function_exists( 'aa_entrymeta' ) ) :
  2. /**
  3. * Prints HTML with meta information for the current post-date/time and author. If post was updated, it also prints
  4. * the date of the update.
  5. */
  6. function aa_entrymeta() {
  7. $time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>';
  8. $update_time_string = '<time class="updated" datetime="%s">%s</time>';
  9.  
  10. $time_string = sprintf( $time_string,
  11. esc_attr( get_the_date( 'c' ) ),
  12. esc_html( get_the_date() )
  13. );
  14.  
  15. $posted_on = sprintf(
  16. _x( 'Posted on %s', 'post date', 'codeaurooba' ),
  17. '<a href="' . esc_url( get_permalink() ) . '" rel="bookmark">' . $time_string . '</a>'
  18. );
  19.  
  20. $byline = sprintf(
  21. _x( 'by %s', 'post author', 'codeaurooba' ),
  22. '<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>'
  23. );
  24.  
  25. if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) {
  26. $update_time_string = sprintf( $update_time_string,
  27. esc_attr( get_the_modified_date( 'c' ) ),
  28. esc_html( get_the_modified_date() )
  29. );
  30.  
  31. $updated_on = sprintf(
  32. _x( 'Updated on %s', 'updated date', 'codeaurooba' ),
  33. '<a href="' . esc_url( get_permalink() ) . '" rel="bookmark">' . $update_time_string . '</a>'
  34. );
  35.  
  36. echo '<span class="posted-on">' . $posted_on . '</span><span class="updated-on">' . $updated_on .'</span><span class="byline">' . $byline . '</span>';
  37. } else {
  38. echo '<span class="posted-on">' . $posted_on . '</span><span class="byline">' . $byline . '</span>';
  39. }
  40.  
  41. }
  42. endif;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement