From 159ec5c8052e1d061a430893a4525629849e2589 Mon Sep 17 00:00:00 2001 From: "Anthony G. Basile" Date: Mon, 20 Nov 2017 16:50:38 -0500 Subject: Update jetpack 5.5 Signed-off-by: Anthony G. Basile --- .../infinite-scroll/themes/twentyfourteen.php | 25 +++++++++++----------- 1 file changed, 12 insertions(+), 13 deletions(-) (limited to 'plugins/jetpack/modules/infinite-scroll/themes/twentyfourteen.php') diff --git a/plugins/jetpack/modules/infinite-scroll/themes/twentyfourteen.php b/plugins/jetpack/modules/infinite-scroll/themes/twentyfourteen.php index 22ae3844..54a1fbc8 100644 --- a/plugins/jetpack/modules/infinite-scroll/themes/twentyfourteen.php +++ b/plugins/jetpack/modules/infinite-scroll/themes/twentyfourteen.php @@ -8,42 +8,41 @@ /** * Add theme support for infinite scroll */ -function twentyfourteen_infinite_scroll_init() { +function jetpack_twentyfourteen_infinite_scroll_init() { add_theme_support( 'infinite-scroll', array( - 'container' => 'content', - 'footer' => 'page' + 'container' => 'content', + 'footer' => 'page', + 'footer_widgets' => jetpack_twentyfourteen_has_footer_widgets(), ) ); } -add_action( 'after_setup_theme', 'twentyfourteen_infinite_scroll_init' ); +add_action( 'after_setup_theme', 'jetpack_twentyfourteen_infinite_scroll_init' ); /** * Switch to the "click to load" type IS with the following cases * 1. Viewed from iPad and the primary sidebar is active. - * 2. Viewed from mobile and either the primary or the content sudebar is active. + * 2. Viewed from mobile and either the primary or the content sidebar is active. * 3. The footer widget is active. * * @return bool */ - -if ( function_exists( 'jetpack_is_mobile' ) ) { - function twentyfourteen_has_footer_widgets( $has_widgets ) { +function jetpack_twentyfourteen_has_footer_widgets() { + if ( function_exists( 'jetpack_is_mobile' ) ) { if ( ( Jetpack_User_Agent_Info::is_ipad() && is_active_sidebar( 'sidebar-1' ) ) || ( jetpack_is_mobile( '', true ) && ( is_active_sidebar( 'sidebar-1' ) || is_active_sidebar( 'sidebar-2' ) ) ) || is_active_sidebar( 'sidebar-3' ) ) return true; - - return $has_widgets; } - add_filter( 'infinite_scroll_has_footer_widgets', 'twentyfourteen_has_footer_widgets' ); + + return false; } /** * Enqueue CSS stylesheet with theme styles for Infinite Scroll. */ -function twentyfourteen_infinite_scroll_enqueue_styles() { +function jetpack_twentyfourteen_infinite_scroll_enqueue_styles() { if ( wp_script_is( 'the-neverending-homepage' ) ) { wp_enqueue_style( 'infinity-twentyfourteen', plugins_url( 'twentyfourteen.css', __FILE__ ), array( 'the-neverending-homepage' ), '20131118' ); } } -add_action( 'wp_enqueue_scripts', 'twentyfourteen_infinite_scroll_enqueue_styles', 25 ); \ No newline at end of file +add_action( 'wp_enqueue_scripts', 'jetpack_twentyfourteen_infinite_scroll_enqueue_styles', 25 ); -- cgit v1.2.3-65-gdbad