Last active
January 25, 2017 23:08
-
-
Save mor10/218cde9ce4214bddc96d993da4938309 to your computer and use it in GitHub Desktop.
Print Twenty Sixteen meta content in custom post type posts through child theme
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Prints HTML with meta information for the categories, tags, etc. | |
* Augmented from the Twenty Sixteen original, found in inc/template-tags.php | |
*/ | |
function twentysixteen_entry_meta() { | |
if ( 'post' === get_post_type() || 'lecture' === get_post_type() ) { | |
$author_avatar_size = apply_filters( 'twentysixteen_author_avatar_size', 49 ); | |
printf( '<span class="byline"><span class="author vcard">%1$s<span class="screen-reader-text">%2$s </span> <a class="url fn n" href="%3$s">%4$s</a></span></span>', | |
get_avatar( get_the_author_meta( 'user_email' ), $author_avatar_size ), | |
_x( 'Author', 'Used before post author name.', 'wpcampus' ), | |
esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ), | |
get_the_author() | |
); | |
} | |
if ( in_array( get_post_type(), array( 'post', 'lecture', 'attachment' ) ) ) { | |
twentysixteen_entry_date(); | |
} | |
$format = get_post_format(); | |
if ( current_theme_supports( 'post-formats', $format ) ) { | |
printf( '<span class="entry-format">%1$s<a href="%2$s">%3$s</a></span>', | |
sprintf( '<span class="screen-reader-text">%s </span>', _x( 'Format', 'Used before post format.', 'wpcampus' ) ), | |
esc_url( get_post_format_link( $format ) ), | |
get_post_format_string( $format ) | |
); | |
} | |
if ( 'post' === get_post_type() || 'lecture' === get_post_type() ) { | |
twentysixteen_entry_taxonomies(); | |
} | |
if ( ! is_singular() && ! post_password_required() && ( comments_open() || get_comments_number() ) ) { | |
echo '<span class="comments-link">'; | |
comments_popup_link( sprintf( __( 'Leave a comment<span class="screen-reader-text"> on %s</span>', 'wpcampus' ), get_the_title() ) ); | |
echo '</span>'; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment