Advertisement
Guest User

Untitled

a guest
Dec 15th, 2014
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.72 KB | None | 0 0
  1. <?php
  2.  
  3. add_action( 'wp_enqueue_scripts', 'enqueue_parent_theme_style' );
  4. function enqueue_parent_theme_style() {
  5.   wp_enqueue_style( 'parent-style', get_template_directory_uri().'/style.css' );
  6. }
  7.  
  8. function twentytwelve_entry_meta() {
  9.   // Translators: used between list items, there is a space after the comma.
  10.   $categories_list = get_the_category_list( __( ', ', 'twentytwelve' ) );
  11.  
  12.   // Translators: used between list items, there is a space after the comma.
  13.   $tag_list = get_the_tag_list( '', __( ', ', 'twentytwelve' ) );
  14.  
  15.   $date = sprintf( '<a href="%1$s" title="%2$s" rel="bookmark"><time class="entry-date" datetime="%3$s">%4$s</time></a>',
  16.     esc_url( get_permalink() ),
  17.     esc_attr( get_the_time() ),
  18.     esc_attr( get_the_date( 'c' ) ),
  19.     esc_html( get_the_date() )
  20.   );
  21.  
  22.   $author = sprintf( '<span class="author vcard"><a class="url fn n" href="%1$s" title="%2$s" rel="author">%3$s</a></span>',
  23.     esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
  24.     esc_attr( sprintf( __( 'View all posts by %s', 'twentytwelve' ), get_the_author() ) ),
  25.     get_the_author()
  26.   );
  27.  
  28.   // Translators: 1 is category, 2 is tag, 3 is the date and 4 is the author's name.
  29.   if ( $tag_list ) {
  30.     $utility_text = __( 'This entry was posted in %1$s on %3$s<span class="by-author"> by %4$s</span>.', 'twentytwelve' );
  31.   } elseif ( $categories_list ) {
  32.     $utility_text = __( 'This entry was posted in %1$s on %3$s<span class="by-author"> by %4$s</span>.', 'twentytwelve' );
  33.   } else {
  34.     $utility_text = __( 'This entry was posted on %3$s<span class="by-author"> by %4$s</span>.', 'twentytwelve' );
  35.   }
  36.  
  37.   printf(
  38.     $utility_text,
  39.     $categories_list,
  40.     $tag_list,
  41.     $date,
  42.     $author
  43.   );
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement