twentyeleven.css
5 years ago
twentyeleven.php
4 years ago
twentyfifteen-rtl.css
11 years ago
twentyfifteen.css
11 years ago
twentyfifteen.php
4 years ago
twentyfourteen.css
11 years ago
twentyfourteen.php
4 years ago
twentyseventeen-rtl.css
9 years ago
twentyseventeen.css
9 years ago
twentyseventeen.php
4 years ago
twentysixteen-rtl.css
10 years ago
twentysixteen.css
10 years ago
twentysixteen.php
4 years ago
twentyten.css
11 years ago
twentyten.php
4 years ago
twentythirteen.css
13 years ago
twentythirteen.php
4 years ago
twentytwelve.css
11 years ago
twentytwelve.php
4 years ago
twentyeleven.php
52 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Infinite Scroll Theme Assets |
| 4 | * |
| 5 | * Register support for @Twenty Eleven and enqueue relevant styles. |
| 6 | * |
| 7 | * @package jetpack |
| 8 | */ |
| 9 | |
| 10 | /** |
| 11 | * Add theme support for infinity scroll |
| 12 | */ |
| 13 | function jetpack_twentyeleven_infinite_scroll_init() { |
| 14 | add_theme_support( |
| 15 | 'infinite-scroll', |
| 16 | array( |
| 17 | 'container' => 'content', |
| 18 | 'footer' => 'page', |
| 19 | 'footer_widgets' => jetpack_twentyeleven_has_footer_widgets(), |
| 20 | ) |
| 21 | ); |
| 22 | } |
| 23 | add_action( 'init', 'jetpack_twentyeleven_infinite_scroll_init' ); |
| 24 | |
| 25 | /** |
| 26 | * Enqueue CSS stylesheet with theme styles for infinity. |
| 27 | */ |
| 28 | function jetpack_twentyeleven_infinite_scroll_enqueue_styles() { |
| 29 | if ( wp_script_is( 'the-neverending-homepage' ) ) { |
| 30 | // Add theme specific styles. |
| 31 | wp_enqueue_style( 'infinity-twentyeleven', plugins_url( 'twentyeleven.css', __FILE__ ), array( 'the-neverending-homepage' ), '20121002' ); |
| 32 | } |
| 33 | } |
| 34 | add_action( 'wp_enqueue_scripts', 'jetpack_twentyeleven_infinite_scroll_enqueue_styles', 25 ); |
| 35 | |
| 36 | /** |
| 37 | * Do we have footer widgets? |
| 38 | */ |
| 39 | function jetpack_twentyeleven_has_footer_widgets() { |
| 40 | // Are any of the "Footer Area" sidebars active? |
| 41 | if ( is_active_sidebar( 'sidebar-3' ) || is_active_sidebar( 'sidebar-4' ) || is_active_sidebar( 'sidebar-5' ) ) { |
| 42 | return true; |
| 43 | } |
| 44 | |
| 45 | // If we're on mobile and the Main Sidebar has widgets, it falls below the content, so we have footer widgets. |
| 46 | if ( function_exists( 'jetpack_is_mobile' ) && jetpack_is_mobile() && is_active_sidebar( 'sidebar-1' ) ) { |
| 47 | return true; |
| 48 | } |
| 49 | |
| 50 | return false; |
| 51 | } |
| 52 |