Advertisement
Guest User

boilerplate_posted_on

a guest
Apr 14th, 2012
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.76 KB | None | 0 0
  1. if ( ! function_exists( 'boilerplate_posted_on' ) ) :
  2. /**
  3.  * Prints HTML with meta information for the current post—date/time and author.
  4.  *
  5.  * @since Twenty Ten 1.0
  6.  */
  7. function boilerplate_posted_on() {
  8.     // BP: slight modification to Twenty Ten function, converting single permalink to multi-archival link
  9.     // Y = 2012
  10.     // F = September
  11.     // m = 01–12
  12.     // j = 1–31
  13.     // d = 01–31
  14.     printf( __( '<span class="%1$s">Posted on</span> <span class="entry-date">%2$s %3$s %4$s</span> <span class="meta-sep">by</span> %5$s', 'boilerplate' ),
  15.         // %1$s = container class
  16.         'meta-prep meta-prep-author',
  17.         // %2$s = month: /yyyy/mm/
  18.         sprintf( '<a href="%1$s" title="%2$s" rel="bookmark">%3$s</a>',
  19.             home_url() . '/' . get_the_date( 'Y' ) . '/' . get_the_date( 'm' ) . '/',
  20.             esc_attr( 'View Archives for ' . get_the_date( 'F' ) . ' ' . get_the_date( 'Y' ) ),
  21.             get_the_date( 'F' )
  22.         ),
  23.         // %3$s = day: /yyyy/mm/dd/
  24.         sprintf( '<a href="%1$s" title="%2$s" rel="bookmark">%3$s</a>',
  25.             home_url() . '/' . get_the_date( 'Y' ) . '/' . get_the_date( 'm' ) . '/' . get_the_date( 'd' ) . '/',
  26.             esc_attr( 'View Archives for ' . get_the_date( 'F' ) . ' ' . get_the_date( 'j' ) . ' ' . get_the_date( 'Y' ) ),
  27.             get_the_date( 'j' )
  28.         ),
  29.         // %4$s = year: /yyyy/
  30.         sprintf( '<a href="%1$s" title="%2$s" rel="bookmark">%3$s</a>',
  31.             home_url() . '/' . get_the_date( 'Y' ) . '/',
  32.             esc_attr( 'View Archives for ' . get_the_date( 'Y' ) ),
  33.             get_the_date( 'Y' )
  34.         ),
  35.         // %5$s = author vcard
  36.         sprintf( '<span class="author vcard"><a class="url fn n" href="%1$s" title="%2$s">%3$s</a></span>',
  37.             get_author_posts_url( get_the_author_meta( 'ID' ) ),
  38.             sprintf( esc_attr__( 'View all posts by %s', 'boilerplate' ), get_the_author() ),
  39.             get_the_author()
  40.         )
  41.     );
  42. }
  43. endif;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement