Advertisement
Guest User

Untitled

a guest
Oct 30th, 2014
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.90 KB | None | 0 0
  1. /**
  2.  * Prints HTML with meta information for the current post-date/time and author.
  3.  */
  4.  
  5. function stag_posted_on() {
  6.  
  7.  
  8.     $author = get_the_author();
  9.  
  10.     if( $author == '' ) {
  11.         global $wp_query;
  12.         $authordata = $GLOBALS['authordata'] = get_userdata( $wp_query->post->post_author );
  13.         $author = $authordata->display_name;
  14.     }
  15.  
  16.     printf( __( '<span class="posted-on">%1$s</span><span class="byline">%2$s</span>', 'stag' ),
  17.         sprintf( '<a href="%1$s" title="%2$s" rel="bookmark">%3$s</a>',
  18.             esc_url( get_permalink() ),
  19.             esc_attr( get_the_time() ),
  20.             $time_string
  21.         ),
  22.         sprintf( '<span class="author vcard"><a class="url fn n" href="%1$s">%2$s</a></span><span class="author vcard"><a class="url fn n" href=""></a></span>',
  23.             esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
  24.             esc_html( $author )
  25. ),
  26.         stag_post_reading_time()
  27.     );
  28.     }
  29. endif;  // ends check for stag_posted_on()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement