forked from mirror/_s
Move template parts into their own dedicated folder and update Infinite Scroll to reflect this change. See #642. Props @leopuleo.
This commit is contained in:
parent
ff6337943b
commit
71d4231cbe
|
@ -29,7 +29,7 @@ get_header(); ?>
|
||||||
* If you want to override this in a child theme, then include a file
|
* 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 Format name) and that will be used instead.
|
||||||
*/
|
*/
|
||||||
get_template_part( 'content', get_post_format() );
|
get_template_part( 'template-parts/content', get_post_format() );
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<?php endwhile; ?>
|
<?php endwhile; ?>
|
||||||
|
@ -38,7 +38,7 @@ get_header(); ?>
|
||||||
|
|
||||||
<?php else : ?>
|
<?php else : ?>
|
||||||
|
|
||||||
<?php get_template_part( 'content', 'none' ); ?>
|
<?php get_template_part( 'template-parts/content', 'none' ); ?>
|
||||||
|
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,15 @@
|
||||||
function _s_jetpack_setup() {
|
function _s_jetpack_setup() {
|
||||||
add_theme_support( 'infinite-scroll', array(
|
add_theme_support( 'infinite-scroll', array(
|
||||||
'container' => 'main',
|
'container' => 'main',
|
||||||
|
'render' => '_s_infinite_scroll_render',
|
||||||
'footer' => 'page',
|
'footer' => 'page',
|
||||||
) );
|
) );
|
||||||
}
|
} // end function _s_jetpack_setup
|
||||||
add_action( 'after_setup_theme', '_s_jetpack_setup' );
|
add_action( 'after_setup_theme', '_s_jetpack_setup' );
|
||||||
|
|
||||||
|
function _s_infinite_scroll_render() {
|
||||||
|
while ( have_posts() ) {
|
||||||
|
the_post();
|
||||||
|
get_template_part( 'template-parts/content', get_post_format() );
|
||||||
|
}
|
||||||
|
} // end function _s_infinite_scroll_render
|
|
@ -26,7 +26,7 @@ get_header(); ?>
|
||||||
* If you want to override this in a child theme, then include a file
|
* 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 Format name) and that will be used instead.
|
||||||
*/
|
*/
|
||||||
get_template_part( 'content', get_post_format() );
|
get_template_part( 'template-parts/content', get_post_format() );
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<?php endwhile; ?>
|
<?php endwhile; ?>
|
||||||
|
@ -35,7 +35,7 @@ get_header(); ?>
|
||||||
|
|
||||||
<?php else : ?>
|
<?php else : ?>
|
||||||
|
|
||||||
<?php get_template_part( 'content', 'none' ); ?>
|
<?php get_template_part( 'template-parts/content', 'none' ); ?>
|
||||||
|
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
|
|
2
page.php
2
page.php
|
@ -17,7 +17,7 @@ get_header(); ?>
|
||||||
|
|
||||||
<?php while ( have_posts() ) : the_post(); ?>
|
<?php while ( have_posts() ) : the_post(); ?>
|
||||||
|
|
||||||
<?php get_template_part( 'content', 'page' ); ?>
|
<?php get_template_part( 'template-parts/content', 'page' ); ?>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
// If comments are open or we have at least one comment, load up the comment template
|
// If comments are open or we have at least one comment, load up the comment template
|
||||||
|
|
|
@ -25,7 +25,7 @@ get_header(); ?>
|
||||||
* If you want to overload this in a child theme then include a file
|
* If you want to overload this in a child theme then include a file
|
||||||
* called content-search.php and that will be used instead.
|
* called content-search.php and that will be used instead.
|
||||||
*/
|
*/
|
||||||
get_template_part( 'content', 'search' );
|
get_template_part( 'template-parts/content', 'search' );
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<?php endwhile; ?>
|
<?php endwhile; ?>
|
||||||
|
@ -34,7 +34,7 @@ get_header(); ?>
|
||||||
|
|
||||||
<?php else : ?>
|
<?php else : ?>
|
||||||
|
|
||||||
<?php get_template_part( 'content', 'none' ); ?>
|
<?php get_template_part( 'template-parts/content', 'none' ); ?>
|
||||||
|
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@ get_header(); ?>
|
||||||
|
|
||||||
<?php while ( have_posts() ) : the_post(); ?>
|
<?php while ( have_posts() ) : the_post(); ?>
|
||||||
|
|
||||||
<?php get_template_part( 'content', 'single' ); ?>
|
<?php get_template_part( 'template-parts/content', 'single' ); ?>
|
||||||
|
|
||||||
<?php the_post_navigation(); ?>
|
<?php the_post_navigation(); ?>
|
||||||
|
|
||||||
|
|
Reference in New Issue