Skip to content

Commit

Permalink
Add support for post formats in single post
Browse files Browse the repository at this point in the history
  • Loading branch information
grappler committed Dec 4, 2015
1 parent 5e507c2 commit 60f7311
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 37 deletions.
2 changes: 1 addition & 1 deletion single.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<?php
while ( have_posts() ) : the_post();

get_template_part( 'template-parts/content', 'single' );
get_template_part( 'template-parts/content', get_post_format() );

the_post_navigation();

Expand Down
35 changes: 0 additions & 35 deletions template-parts/content-single.php

This file was deleted.

6 changes: 5 additions & 1 deletion template-parts/content.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header class="entry-header">
<?php
the_title( sprintf( '<h2 class="entry-title"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h2>' );
if ( is_single() ) {
the_title( '<h1 class="entry-title">', '</h1>' );
} else {
the_title( '<h2 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h2>' );
}

if ( 'post' === get_post_type() ) : ?>
<div class="entry-meta">
Expand Down

0 comments on commit 60f7311

Please sign in to comment.