Advertisement
alchymyth

function

Jul 25th, 2013
282
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.03 KB | None | 0 0
  1. function twentytwelve_entry_meta() {
  2.     $categories_list = get_the_category_list( __( ', ', 'twentytwelve' ) );
  3.  
  4.     $date = sprintf( '<a href="%1$s" title="%2$s" rel="bookmark"><time class="entry-date" datetime="%3$s">%4$s</time></a>',
  5.         esc_url( get_permalink() ),
  6.         esc_attr( get_the_time() ),
  7.         esc_attr( get_the_date( 'c' ) ),
  8.         esc_html( get_the_date() )
  9.     );
  10.  
  11.     $author = sprintf( '<span class="author vcard"><a class="url fn n" href="%1$s" title="%2$s" rel="author">%3$s</a></span>',
  12.         esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
  13.         esc_attr( sprintf( __( 'View all posts by %s', 'twentytwelve' ), get_the_author() ) ),
  14.         get_the_author()
  15.     );
  16.  
  17. if ( is_single() && $categories_list ) {
  18.         $utility_text = __( 'This entry was posted in %1$s on %2$s<span class="by-author"> by %3$s</span>.', 'twentytwelve' );
  19.     } else {
  20.         $utility_text = __( 'This entry was posted on %2$s<span class="by-author"> by %3$s</span>.', 'twentytwelve' );
  21.     }
  22.  
  23.     printf(
  24.         $utility_text,
  25.         $categories_list,
  26.         $date,
  27.         $author
  28.     );
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement