2013-02-03 07:03:40 +00:00
|
|
|
<?php
|
|
|
|
/**
|
2015-07-01 15:21:44 +00:00
|
|
|
* Jetpack Compatibility File.
|
|
|
|
*
|
|
|
|
* @link https://jetpack.me/
|
2013-02-03 07:03:40 +00:00
|
|
|
*
|
2013-02-25 07:15:14 +00:00
|
|
|
* @package _s
|
2013-02-03 07:03:40 +00:00
|
|
|
*/
|
|
|
|
|
2015-10-26 15:33:55 +00:00
|
|
|
/**
|
|
|
|
* Jetpack setup function.
|
|
|
|
*
|
|
|
|
* See: https://jetpack.me/support/infinite-scroll/
|
|
|
|
* See: https://jetpack.me/support/responsive-videos/
|
|
|
|
*/
|
2013-05-20 11:02:30 +00:00
|
|
|
function _s_jetpack_setup() {
|
2015-10-26 15:33:55 +00:00
|
|
|
// Add theme support for Infinite Scroll.
|
2013-02-03 07:03:40 +00:00
|
|
|
add_theme_support( 'infinite-scroll', array(
|
2013-07-30 19:12:45 +00:00
|
|
|
'container' => 'main',
|
2015-04-29 01:42:12 +00:00
|
|
|
'render' => '_s_infinite_scroll_render',
|
2013-02-03 07:03:40 +00:00
|
|
|
'footer' => 'page',
|
|
|
|
) );
|
2015-10-13 10:39:42 +00:00
|
|
|
|
2015-10-26 15:33:55 +00:00
|
|
|
// Add theme support for Responsive Videos.
|
2015-10-13 10:39:42 +00:00
|
|
|
add_theme_support( 'jetpack-responsive-videos' );
|
2015-12-15 02:05:14 +00:00
|
|
|
}
|
2013-05-20 11:02:30 +00:00
|
|
|
add_action( 'after_setup_theme', '_s_jetpack_setup' );
|
2015-04-29 01:42:12 +00:00
|
|
|
|
2015-05-27 17:49:01 +00:00
|
|
|
/**
|
|
|
|
* Custom render function for Infinite Scroll.
|
|
|
|
*/
|
2015-04-29 01:42:12 +00:00
|
|
|
function _s_infinite_scroll_render() {
|
|
|
|
while ( have_posts() ) {
|
|
|
|
the_post();
|
2015-11-10 05:37:39 +00:00
|
|
|
if ( is_search() ) :
|
|
|
|
get_template_part( 'template-parts/content', 'search' );
|
|
|
|
else :
|
|
|
|
get_template_part( 'template-parts/content', get_post_format() );
|
|
|
|
endif;
|
2015-04-29 01:42:12 +00:00
|
|
|
}
|
2015-12-15 02:05:14 +00:00
|
|
|
}
|