forked from mirror/_s
Add support for post formats in single post
This commit is contained in:
parent
5e507c269e
commit
60f7311f19
|
@ -15,7 +15,7 @@ get_header(); ?>
|
||||||
<?php
|
<?php
|
||||||
while ( have_posts() ) : the_post();
|
while ( have_posts() ) : the_post();
|
||||||
|
|
||||||
get_template_part( 'template-parts/content', 'single' );
|
get_template_part( 'template-parts/content', get_post_format() );
|
||||||
|
|
||||||
the_post_navigation();
|
the_post_navigation();
|
||||||
|
|
||||||
|
|
|
@ -1,35 +0,0 @@
|
||||||
<?php
|
|
||||||
/**
|
|
||||||
* Template part for displaying single posts.
|
|
||||||
*
|
|
||||||
* @link https://codex.wordpress.org/Template_Hierarchy
|
|
||||||
*
|
|
||||||
* @package _s
|
|
||||||
*/
|
|
||||||
|
|
||||||
?>
|
|
||||||
|
|
||||||
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
|
|
||||||
<header class="entry-header">
|
|
||||||
<?php the_title( '<h1 class="entry-title">', '</h1>' ); ?>
|
|
||||||
|
|
||||||
<div class="entry-meta">
|
|
||||||
<?php _s_posted_on(); ?>
|
|
||||||
</div><!-- .entry-meta -->
|
|
||||||
</header><!-- .entry-header -->
|
|
||||||
|
|
||||||
<div class="entry-content">
|
|
||||||
<?php
|
|
||||||
the_content();
|
|
||||||
|
|
||||||
wp_link_pages( array(
|
|
||||||
'before' => '<div class="page-links">' . esc_html__( 'Pages:', '_s' ),
|
|
||||||
'after' => '</div>',
|
|
||||||
) );
|
|
||||||
?>
|
|
||||||
</div><!-- .entry-content -->
|
|
||||||
|
|
||||||
<footer class="entry-footer">
|
|
||||||
<?php _s_entry_footer(); ?>
|
|
||||||
</footer><!-- .entry-footer -->
|
|
||||||
</article><!-- #post-## -->
|
|
|
@ -12,7 +12,11 @@
|
||||||
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
|
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
|
||||||
<header class="entry-header">
|
<header class="entry-header">
|
||||||
<?php
|
<?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() ) : ?>
|
if ( 'post' === get_post_type() ) : ?>
|
||||||
<div class="entry-meta">
|
<div class="entry-meta">
|
||||||
|
|
Reference in New Issue