Browse Source

added support content formats

master
3err0 3 years ago
parent
commit
d990c388b8
  1. 14
      functions.php
  2. 6
      single.php
  3. 9
      template/post/content.php

14
functions.php

@ -0,0 +1,14 @@
<?php
function zerro_setup() {
add_theme_support(
'post-formats',
array(
'image',)
);
}
add_action( 'after_setup_theme', 'zerro_setup' );
?>

6
single.php

@ -3,10 +3,8 @@
if ( have_posts() ) {
the_post();
echo '<div class="content">';
echo "<h1>", the_title(), "</h1>";
the_content();
echo '</div>';
get_template_part( 'template/post/content', get_post_format() );
}
get_footer();

9
template/post/content.php

@ -0,0 +1,9 @@
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<?php
echo '<div class="content">';
echo "<h1>", the_title(), "</h1>";
the_content();
echo '</div>';
?>
</article>
Loading…
Cancel
Save