diff options
Diffstat (limited to 'plugins/jetpack/modules/infinite-scroll/themes')
6 files changed, 224 insertions, 0 deletions
diff --git a/plugins/jetpack/modules/infinite-scroll/themes/twentyeleven.css b/plugins/jetpack/modules/infinite-scroll/themes/twentyeleven.css new file mode 100644 index 00000000..cc232785 --- /dev/null +++ b/plugins/jetpack/modules/infinite-scroll/themes/twentyeleven.css @@ -0,0 +1,45 @@ +/* =Infinity Styles +-------------------------------------------------------------- */ +.infinite-scroll #main:after { + clear: both; + content: ''; + display: block; +} +.infinite-scroll #content { + margin-bottom: 40px; +} +.infinite-scroll.neverending #content { + margin-bottom: 70px; +} +.infinite-scroll .infinite-wrap { + border-top: none; + padding-top: 0; +} +.infinite-scroll .infinite-wrap .hentry:last-child { + border-bottom: 1px solid #ddd; +} +.infinite-scroll .infinite-wrap:last-of-type .hentry:last-child { + border-bottom: none; +} + +/** + * Elements to hide: + * (footer widgets, post navigation, regular footer) + */ +.infinite-scroll.neverending #colophon #supplementary, +.infinite-scroll #nav-below, +.infinite-scroll.neverending #colophon { + display: none; +} + +/* Hooks to infinity-end body class to restore footer */ +.infinity-end.neverending #colophon { + display: block; +} + +/* For responsive CSS */ +@media (max-width: 800px) { + .infinite-scroll #infinite-handle { + padding-bottom: 40px; + } +}
\ No newline at end of file diff --git a/plugins/jetpack/modules/infinite-scroll/themes/twentyeleven.php b/plugins/jetpack/modules/infinite-scroll/themes/twentyeleven.php new file mode 100644 index 00000000..a80ee810 --- /dev/null +++ b/plugins/jetpack/modules/infinite-scroll/themes/twentyeleven.php @@ -0,0 +1,27 @@ +<?php +/** + * Infinite Scroll Theme Assets + * + * Register support for @Twenty Eleven and enqueue relevant styles. + */ + +/** + * Add theme support for infinity scroll + */ +function twenty_eleven_infinite_scroll_init() { + add_theme_support( 'infinite-scroll', array( + 'container' => 'content', + 'footer_widgets' => array( 'sidebar-3', 'sidebar-4', 'sidebar-5' ), + 'footer' => 'page', + ) ); +} +add_action( 'init', 'twenty_eleven_infinite_scroll_init' ); + +/** + * Enqueue CSS stylesheet with theme styles for infinity. + */ +function twenty_eleven_infinite_scroll_enqueue_styles() { + // Add theme specific styles. + wp_enqueue_style( 'infinity-twentyeleven', plugins_url( 'twentyeleven.css', __FILE__ ), array( 'the-neverending-homepage' ), '20121002' ); +} +add_action( 'wp_enqueue_scripts', 'twenty_eleven_infinite_scroll_enqueue_styles', 25 );
\ No newline at end of file diff --git a/plugins/jetpack/modules/infinite-scroll/themes/twentyten.css b/plugins/jetpack/modules/infinite-scroll/themes/twentyten.css new file mode 100644 index 00000000..889abb3f --- /dev/null +++ b/plugins/jetpack/modules/infinite-scroll/themes/twentyten.css @@ -0,0 +1,25 @@ +/* =Infinity Styles +-------------------------------------------------------------- */ +.infinite-scroll #wrapper { + margin-bottom: 40px; +} +.infinite-scroll #content { + margin-bottom: 50px; +} +.infinite-scroll #content .infinite-wrap { + padding-top: 0; + border-top: 0; +} +/* Elements to hide */ +.infinite-scroll #nav-above, +.infinite-scroll #nav-below, +.infinite-scroll.neverending #footer { + display: none; +} +/* Restore the footer when IS is finished */ +.infinity-end.neverending #footer { + display: block; +} +#infinite-footer .blog-info a { + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; +}
\ No newline at end of file diff --git a/plugins/jetpack/modules/infinite-scroll/themes/twentyten.php b/plugins/jetpack/modules/infinite-scroll/themes/twentyten.php new file mode 100644 index 00000000..094cef9c --- /dev/null +++ b/plugins/jetpack/modules/infinite-scroll/themes/twentyten.php @@ -0,0 +1,48 @@ +<?php +/** + * Infinite Scroll Theme Assets + * + * Register support for @Twenty Ten and enqueue relevant styles. + */ + +/** + * Add theme support for infinity scroll + */ +function twenty_ten_infinite_scroll_init() { + add_theme_support( 'infinite-scroll', array( + 'container' => 'content', + 'render' => 'twenty_ten_infinite_scroll_render', + 'footer' => 'wrapper', + ) ); +} +add_action( 'init', 'twenty_ten_infinite_scroll_init' ); + +/** + * Set the code to be rendered on for calling posts, + * hooked to template parts when possible. + * + * Note: must define a loop. + */ +function twenty_ten_infinite_scroll_render() { + get_template_part( 'loop' ); +} + +/** + * Enqueue CSS stylesheet with theme styles for infinity. + */ +function twenty_ten_infinite_scroll_enqueue_styles() { + // Add theme specific styles. + wp_enqueue_style( 'infinity-twentyten', plugins_url( 'twentyten.css', __FILE__ ), array( 'the-neverending-homepage' ), '20121002' ); +} +add_action( 'wp_enqueue_scripts', 'twenty_ten_infinite_scroll_enqueue_styles', 25 ); + +/** + * Do we have footer widgets? + */ +function twenty_ten_has_footer_widgets( $has_widgets ) { + if ( is_active_sidebar( 'first-footer-widget-area' ) || is_active_sidebar( 'second-footer-widget-area' ) || is_active_sidebar( 'third-footer-widget-area' ) || is_active_sidebar( 'fourth-footer-widget-area' ) ) + $has_widgets = true; + + return $has_widgets; +} +add_filter( 'infinite_scroll_has_footer_widgets', 'twenty_ten_has_footer_widgets' );
\ No newline at end of file diff --git a/plugins/jetpack/modules/infinite-scroll/themes/twentytwelve.css b/plugins/jetpack/modules/infinite-scroll/themes/twentytwelve.css new file mode 100644 index 00000000..032c2c9a --- /dev/null +++ b/plugins/jetpack/modules/infinite-scroll/themes/twentytwelve.css @@ -0,0 +1,33 @@ +/* =Infinity Styles +-------------------------------------------------------------- */ +.infinite-scroll .site-content:after { + clear: both; + content: ''; + display: block; +} +.infinite-wrap { + border-top: 0; +} +.infinite-scroll.neverending .site-content { + margin-bottom: 48px; + margin-bottom: 3.428571429rem; +} + +/* Elements to hide: post navigation, regular footer */ +.infinite-scroll #nav-below, +.infinite-scroll.neverending #colophon { + display: none; +} + +/* Hooks to infinity-end body class to restore footer */ +.infinity-end.neverending #colophon { + display: block; +} + +/* For responsive CSS */ +@media (max-width: 599px) { + .infinite-scroll #infinite-handle { + padding-bottom: 48px; + padding-bottom: 3.428571429rem; + } +}
\ No newline at end of file diff --git a/plugins/jetpack/modules/infinite-scroll/themes/twentytwelve.php b/plugins/jetpack/modules/infinite-scroll/themes/twentytwelve.php new file mode 100644 index 00000000..f8b77011 --- /dev/null +++ b/plugins/jetpack/modules/infinite-scroll/themes/twentytwelve.php @@ -0,0 +1,46 @@ +<?php +/** + * Infinite Scroll Theme Assets + * + * Register support for Twenty Twelve and enqueue relevant styles. + */ + +/** + * Add theme support for infinite scroll + */ +function twenty_twelve_infinite_scroll_init() { + add_theme_support( 'infinite-scroll', array( + 'container' => 'content', + 'footer' => 'page' + ) ); +} +add_action( 'after_setup_theme', 'twenty_twelve_infinite_scroll_init' ); + +/** + * Enqueue CSS stylesheet with theme styles for infinity. + */ +function twenty_twelve_infinite_scroll_enqueue_styles() { + // Add theme specific styles. + wp_enqueue_style( 'infinity-twentytwelve', plugins_url( 'twentytwelve.css', __FILE__ ), array( 'the-neverending-homepage' ), '20120817' ); +} +add_action( 'wp_enqueue_scripts', 'twenty_twelve_infinite_scroll_enqueue_styles', 25 ); + +/** + * Handle `footer_widgets` argument for mobile devices + * + * @param bool $has_widgets + * @uses jetpack_is_mobile, is_front_page, is_active_sidebar + * @filter infinite_scroll_has_footer_widgets + * @return bool + */ +function twenty_twelve_has_footer_widgets( $has_widgets ) { + if ( function_exists( 'jetpack_is_mobile' ) && jetpack_is_mobile() ) { + if ( is_front_page() && ( is_active_sidebar( 'sidebar-2' ) || is_active_sidebar( 'sidebar-3' ) ) ) + $has_widgets = true; + elseif ( is_active_sidebar( 'sidebar-1' ) ) + $has_widgets = true; + } + + return $has_widgets; +} +add_filter( 'infinite_scroll_has_footer_widgets', 'twenty_twelve_has_footer_widgets' );
\ No newline at end of file |