Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- Plugin Name: Entry Meta Twenty Twelve Modified
- Plugin URI: n/a
- Description: personalization of the entry meta of Twenty Twelve without child theme; in this particular example the removal of the tags.
- Version: 1.0
- Author: alchymyth
- Author URI: http://transformationpowertools.com
- License: GPL2
- */
- add_action( 'setup_theme', 'modify_pluggable_theme_functions' );
- function modify_pluggable_theme_functions() {
- if( wp_get_theme() == 'Twenty Twelve' && get_stylesheet_directory() == get_template_directory() ) :
- //check for the right theme and that no child theme is used
- function twentytwelve_entry_meta() {
- // Translators: used between list items, there is a space after the comma.
- $categories_list = get_the_category_list( __( ', ', 'twentytwelve' ) );
- $date = sprintf( '<a href="%1$s" title="%2$s" rel="bookmark"><time class="entry-date" datetime="%3$s">%4$s</time></a>',
- esc_url( get_permalink() ),
- esc_attr( get_the_time() ),
- esc_attr( get_the_date( 'c' ) ),
- esc_html( get_the_date() )
- );
- $author = sprintf( '<span class="author vcard"><a class="url fn n" href="%1$s" title="%2$s" rel="author">%3$s</a></span>',
- esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
- esc_attr( sprintf( __( 'View all posts by %s', 'twentytwelve' ), get_the_author() ) ),
- get_the_author()
- );
- if ( $categories_list ) {
- $utility_text = 'This entry was posted in %1$s on %2$s<span class="by-author"> by %3$s</span>.';
- } else {
- $utility_text = 'This entry was posted on %2$s<span class="by-author"> by %3$s</span>.';
- }
- printf(
- $utility_text,
- $categories_list,
- $date,
- $author
- );
- }
- endif;
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement