Skip to content

Commit

Permalink
MF2 Improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
dshanske committed Oct 5, 2017
1 parent 56a2990 commit 6bac1ad
Show file tree
Hide file tree
Showing 9 changed files with 143 additions and 109 deletions.
2 changes: 1 addition & 1 deletion header.php
Expand Up @@ -29,7 +29,7 @@
<?php twentysixteen_the_custom_logo(); ?>

<?php if ( is_front_page() && is_home() ) : ?>
<h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>
<h1 class="site-title p-name"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>
<?php else : ?>
<p class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></p>
<?php endif;
Expand Down
27 changes: 27 additions & 0 deletions inc/template-functions.php
Expand Up @@ -98,3 +98,30 @@ function twentysixteen_comment_class( $classes ) {
}

add_filter( 'comment_class', 'twentysixteen_comment_class', 11 );

/**
* Wraps the_content in e-content
*
*/
function twentysixteen_the_content( $content ) {
$wrap = '<div class="entry-content e-content">';
if ( empty( $content ) ) {
return $content;
}
return $wrap . $content . '</div>';
}
add_filter( 'the_content', 'twentysixteen_the_content', 1 );

/**
* Wraps the_excerpt in p-summary
*
*/
function twentysixteen_the_excerpt( $content ) {
$wrap = '<div class="entry-summary p-summary">';
if ($content!="") {
return $wrap . $content . '</div>';
}
return $content;
}
add_filter( 'the_excerpt', 'twentysixteen_the_excerpt', 1 );

16 changes: 9 additions & 7 deletions inc/template-tags.php
Expand Up @@ -19,13 +19,15 @@
*/
function twentysixteen_entry_meta() {
if ( 'post' === 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.', 'twentysixteen' ),
esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
get_the_author()
);
if ( is_multi_author() && ! is_singular() ) {
$author_avatar_size = apply_filters( 'twentysixteen_author_avatar_size', 49 );
printf( '<span class="byline"><span class="author vcard h-card">%1$s<span class="screen-reader-text">%2$s </span> <a class="url fn n u-url" 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.', 'twentysixteen' ),
esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
get_the_author()
);
}
}

if ( in_array( get_post_type(), array( 'post', 'attachment' ) ) ) {
Expand Down
14 changes: 9 additions & 5 deletions index.php
Expand Up @@ -32,13 +32,17 @@
while ( have_posts() ) : the_post();

/*
* Include the Post-Format-specific template for the content.
* If installed, include the Post-Kind-specific template for the content.
* If you want to override this in a child theme, then include a file
* called content-___.php (where ___ is the Post Format name) and that will be used instead.
* called content-___.php (where ___ is the Post Kind name) and that will be used instead.
*/
get_template_part( 'template-parts/content', get_post_format() );

// End the loop.
if ( class_exists( 'Kind_Taxonomy' ) ) {
get_template_part( 'template-parts/content', get_post_kind() );
}
else {
get_template_part( 'template-parts/content' );
}
// End the loop.
endwhile;

// Previous/next page navigation.
Expand Down

0 comments on commit 6bac1ad

Please sign in to comment.