Merge pull request #848 from ernilambar/master

respect content-search.php for search result in Jetpack Infinite Scroll
Merging as comments and second opinion given in ticket.
This commit is contained in:
Tammie Lister 2015-11-11 20:33:37 +00:00
commit 2eb3836006
1 changed files with 5 additions and 1 deletions

View File

@ -32,6 +32,10 @@ add_action( 'after_setup_theme', '_s_jetpack_setup' );
function _s_infinite_scroll_render() { function _s_infinite_scroll_render() {
while ( have_posts() ) { while ( have_posts() ) {
the_post(); the_post();
get_template_part( 'template-parts/content', get_post_format() ); if ( is_search() ) :
get_template_part( 'template-parts/content', 'search' );
else :
get_template_part( 'template-parts/content', get_post_format() );
endif;
} }
} // end function _s_infinite_scroll_render } // end function _s_infinite_scroll_render