Use the post-type when choosing template partial

This commit is contained in:
Kelly Dwan 2019-10-09 14:31:24 -04:00
parent 847e99f44e
commit 3847e83cf3
No known key found for this signature in database
GPG key ID: 8BA5575F3D11575D
2 changed files with 6 additions and 10 deletions

View file

@ -26,23 +26,19 @@ get_header(); ?>
while ( have_posts() ) : while ( have_posts() ) :
the_post(); the_post();
/* get_template_part( 'template-parts/content', get_post_type() );
* Include the Post-Format-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.
*/
get_template_part( 'template-parts/content', 'page' );
endwhile; endwhile;
the_posts_pagination(); the_posts_pagination();
else : ?>
<?php else :
get_template_part( 'template-parts/content', 'none' ); get_template_part( 'template-parts/content', 'none' );
endif; endif; ?>
?>
</main><!-- #main --> </main><!-- #main -->

View file

@ -9,7 +9,7 @@ get_header(); ?>
<?php while ( have_posts() ) : <?php while ( have_posts() ) :
the_post(); the_post();
get_template_part( 'template-parts/plugin', 'single' ); get_template_part( 'template-parts/content', get_post_type() );
endwhile; ?> endwhile; ?>
</main><!-- #main --> </main><!-- #main -->