-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjetpack.php
41 lines (38 loc) · 933 Bytes
/
jetpack.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php
/**
* Jetpack Compatibility File.
*
* @link https://jetpack.com/
*
* @package fmd
*/
/**
* Jetpack setup function.
*
* See: https://jetpack.com/support/infinite-scroll/
* See: https://jetpack.com/support/responsive-videos/
*/
function fmd_jetpack_setup() {
// Add theme support for Infinite Scroll.
add_theme_support( 'infinite-scroll', array(
'container' => 'main',
'render' => 'fmd_infinite_scroll_render',
'footer' => 'page',
) );
// Add theme support for Responsive Videos.
add_theme_support( 'jetpack-responsive-videos' );
}
add_action( 'after_setup_theme', 'fmd_jetpack_setup' );
/**
* Custom render function for Infinite Scroll.
*/
function fmd_infinite_scroll_render() {
while ( have_posts() ) {
the_post();
if ( is_search() ) :
get_template_part( 'template-parts/content', 'search' );
else :
get_template_part( 'template-parts/content', get_post_format() );
endif;
}
}