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
twentyten.php
61 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Infinite Scroll Theme Assets |
| 4 | * |
| 5 | * Register support for @Twenty Ten and enqueue relevant styles. |
| 6 | * |
| 7 | * @package jetpack |
| 8 | */ |
| 9 | |
| 10 | /** |
| 11 | * Add theme support for infinity scroll |
| 12 | */ |
| 13 | function jetpack_twentyten_infinite_scroll_init() { |
| 14 | add_theme_support( |
| 15 | 'infinite-scroll', |
| 16 | array( |
| 17 | 'container' => 'content', |
| 18 | 'render' => 'jetpack_twentyten_infinite_scroll_render', |
| 19 | 'footer' => 'wrapper', |
| 20 | 'footer_widgets' => jetpack_twentyten_has_footer_widgets(), |
| 21 | ) |
| 22 | ); |
| 23 | } |
| 24 | add_action( 'init', 'jetpack_twentyten_infinite_scroll_init' ); |
| 25 | |
| 26 | /** |
| 27 | * Set the code to be rendered on for calling posts, |
| 28 | * hooked to template parts when possible. |
| 29 | * |
| 30 | * Note: must define a loop. |
| 31 | */ |
| 32 | function jetpack_twentyten_infinite_scroll_render() { |
| 33 | get_template_part( 'loop' ); |
| 34 | } |
| 35 | |
| 36 | /** |
| 37 | * Enqueue CSS stylesheet with theme styles for infinity. |
| 38 | */ |
| 39 | function jetpack_twentyten_infinite_scroll_enqueue_styles() { |
| 40 | if ( wp_script_is( 'the-neverending-homepage' ) ) { |
| 41 | // Add theme specific styles. |
| 42 | wp_enqueue_style( 'infinity-twentyten', plugins_url( 'twentyten.css', __FILE__ ), array( 'the-neverending-homepage' ), '20121002' ); |
| 43 | } |
| 44 | } |
| 45 | add_action( 'wp_enqueue_scripts', 'jetpack_twentyten_infinite_scroll_enqueue_styles', 25 ); |
| 46 | |
| 47 | /** |
| 48 | * Do we have footer widgets? |
| 49 | */ |
| 50 | function jetpack_twentyten_has_footer_widgets() { |
| 51 | if ( is_active_sidebar( 'first-footer-widget-area' ) || |
| 52 | is_active_sidebar( 'second-footer-widget-area' ) || |
| 53 | is_active_sidebar( 'third-footer-widget-area' ) || |
| 54 | is_active_sidebar( 'fourth-footer-widget-area' ) ) { |
| 55 | |
| 56 | return true; |
| 57 | } |
| 58 | |
| 59 | return false; |
| 60 | } |
| 61 |