Advertisement
alchymyth

remove tags 2012 entry meta

Oct 13th, 2013
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.64 KB | None | 0 0
  1. <?php
  2. /*
  3. Plugin Name: Entry Meta Twenty Twelve Modified
  4. Plugin URI: n/a
  5. Description: personalization of the entry meta of Twenty Twelve without child theme; in this particular example the removal of the tags.
  6. Version: 1.0
  7. Author: alchymyth
  8. Author URI: http://transformationpowertools.com
  9. License: GPL2
  10. */
  11.  
  12. add_action( 'setup_theme', 'modify_pluggable_theme_functions' );
  13.  
  14. function modify_pluggable_theme_functions() {
  15.  
  16. if( wp_get_theme() == 'Twenty Twelve' && get_stylesheet_directory() == get_template_directory() ) :
  17. //check for the right theme and that no child theme is used
  18. function twentytwelve_entry_meta() {
  19.     // Translators: used between list items, there is a space after the comma.
  20.     $categories_list = get_the_category_list( __( ', ', 'twentytwelve' ) );
  21.  
  22.     $date = sprintf( '<a href="%1$s" title="%2$s" rel="bookmark"><time class="entry-date" datetime="%3$s">%4$s</time></a>',
  23.         esc_url( get_permalink() ),
  24.         esc_attr( get_the_time() ),
  25.         esc_attr( get_the_date( 'c' ) ),
  26.         esc_html( get_the_date() )
  27.     );
  28.  
  29.     $author = sprintf( '<span class="author vcard"><a class="url fn n" href="%1$s" title="%2$s" rel="author">%3$s</a></span>',
  30.         esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
  31.         esc_attr( sprintf( __( 'View all posts by %s', 'twentytwelve' ), get_the_author() ) ),
  32.         get_the_author()
  33.     );
  34.  
  35.     if ( $categories_list ) {
  36.         $utility_text = 'This entry was posted in %1$s on %2$s<span class="by-author"> by %3$s</span>.';
  37.     } else {
  38.         $utility_text = 'This entry was posted on %2$s<span class="by-author"> by %3$s</span>.';
  39.     }
  40.  
  41.     printf(
  42.         $utility_text,
  43.         $categories_list,
  44.         $date,
  45.         $author
  46.     );
  47. }
  48. endif;
  49. }
  50. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement