2021-08-01 17:32:46 +00:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Jetpack Compatibility File
|
|
|
|
* See: https://jetpack.me/
|
|
|
|
*
|
2021-08-01 17:45:36 +00:00
|
|
|
* @package Portage
|
2021-08-01 17:32:46 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Add theme support for Infinite Scroll.
|
|
|
|
* See: https://jetpack.me/support/infinite-scroll/
|
|
|
|
*/
|
2021-08-01 17:45:36 +00:00
|
|
|
function portage_jetpack_setup() {
|
2021-08-01 17:32:46 +00:00
|
|
|
add_theme_support( 'infinite-scroll', array(
|
|
|
|
'container' => 'main',
|
2021-08-01 17:45:36 +00:00
|
|
|
'render' => 'portage_infinite_scroll_render',
|
2021-08-01 17:32:46 +00:00
|
|
|
'footer' => 'page',
|
|
|
|
) );
|
2021-08-01 17:45:36 +00:00
|
|
|
} // end function portage_jetpack_setup
|
|
|
|
add_action( 'after_setup_theme', 'portage_jetpack_setup' );
|
2021-08-01 17:32:46 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Custom render function for Infinite Scroll.
|
|
|
|
*/
|
2021-08-01 17:45:36 +00:00
|
|
|
function portage_infinite_scroll_render() {
|
2021-08-01 17:32:46 +00:00
|
|
|
while ( have_posts() ) {
|
|
|
|
the_post();
|
|
|
|
get_template_part( 'template-parts/content', get_post_format() );
|
|
|
|
}
|
2021-08-01 17:45:36 +00:00
|
|
|
} // end function portage_infinite_scroll_render
|