twentyeleven.css
7 months ago
twentyeleven.php
7 months ago
twentyfifteen-rtl.css
11 years ago
twentyfifteen.css
7 months ago
twentyfifteen.php
7 months ago
twentyfourteen.css
7 months ago
twentyfourteen.php
7 months ago
twentyseventeen-rtl.css
9 years ago
twentyseventeen.css
7 months ago
twentyseventeen.php
7 months ago
twentysixteen-rtl.css
10 years ago
twentysixteen.css
7 months ago
twentysixteen.php
7 months ago
twentyten.css
7 months ago
twentyten.php
7 months ago
twentythirteen.css
7 months ago
twentythirteen.php
7 months ago
twentytwelve.css
7 months ago
twentytwelve.php
7 months ago
twentyten.php
65 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 | if ( ! defined( 'ABSPATH' ) ) { |
| 11 | exit( 0 ); |
| 12 | } |
| 13 | |
| 14 | /** |
| 15 | * Add theme support for infinity scroll |
| 16 | */ |
| 17 | function jetpack_twentyten_infinite_scroll_init() { |
| 18 | add_theme_support( |
| 19 | 'infinite-scroll', |
| 20 | array( |
| 21 | 'container' => 'content', |
| 22 | 'render' => 'jetpack_twentyten_infinite_scroll_render', |
| 23 | 'footer' => 'wrapper', |
| 24 | 'footer_widgets' => jetpack_twentyten_has_footer_widgets(), |
| 25 | ) |
| 26 | ); |
| 27 | } |
| 28 | add_action( 'init', 'jetpack_twentyten_infinite_scroll_init' ); |
| 29 | |
| 30 | /** |
| 31 | * Set the code to be rendered on for calling posts, |
| 32 | * hooked to template parts when possible. |
| 33 | * |
| 34 | * Note: must define a loop. |
| 35 | */ |
| 36 | function jetpack_twentyten_infinite_scroll_render() { |
| 37 | get_template_part( 'loop' ); |
| 38 | } |
| 39 | |
| 40 | /** |
| 41 | * Enqueue CSS stylesheet with theme styles for infinity. |
| 42 | */ |
| 43 | function jetpack_twentyten_infinite_scroll_enqueue_styles() { |
| 44 | if ( wp_script_is( 'the-neverending-homepage' ) ) { |
| 45 | // Add theme specific styles. |
| 46 | wp_enqueue_style( 'infinity-twentyten', plugins_url( 'twentyten.css', __FILE__ ), array( 'the-neverending-homepage' ), '20121002' ); |
| 47 | } |
| 48 | } |
| 49 | add_action( 'wp_enqueue_scripts', 'jetpack_twentyten_infinite_scroll_enqueue_styles', 25 ); |
| 50 | |
| 51 | /** |
| 52 | * Do we have footer widgets? |
| 53 | */ |
| 54 | function jetpack_twentyten_has_footer_widgets() { |
| 55 | if ( is_active_sidebar( 'first-footer-widget-area' ) || |
| 56 | is_active_sidebar( 'second-footer-widget-area' ) || |
| 57 | is_active_sidebar( 'third-footer-widget-area' ) || |
| 58 | is_active_sidebar( 'fourth-footer-widget-area' ) ) { |
| 59 | |
| 60 | return true; |
| 61 | } |
| 62 | |
| 63 | return false; |
| 64 | } |
| 65 |