2013-02-03 07:03:40 +00:00
|
|
|
<?php
|
|
|
|
/**
|
2016-09-27 06:04:56 +00:00
|
|
|
* Jetpack Compatibility File
|
2015-07-01 15:21:44 +00:00
|
|
|
*
|
2016-03-10 11:36:21 +00:00
|
|
|
* @link https://jetpack.com/
|
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.
|
|
|
|
*
|
2016-03-10 11:36:21 +00:00
|
|
|
* See: https://jetpack.com/support/infinite-scroll/
|
|
|
|
* See: https://jetpack.com/support/responsive-videos/
|
2015-10-26 15:33:55 +00:00
|
|
|
*/
|
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() ) :
|
2016-07-05 04:04:11 +00:00
|
|
|
get_template_part( 'template-parts/content', 'search' );
|
2015-11-10 05:37:39 +00:00
|
|
|
else :
|
2016-07-05 04:04:11 +00:00
|
|
|
get_template_part( 'template-parts/content', get_post_format() );
|
2015-11-10 05:37:39 +00:00
|
|
|
endif;
|
2015-04-29 01:42:12 +00:00
|
|
|
}
|
2015-12-15 02:05:14 +00:00
|
|
|
}
|