From 16906d44c5709343769a338c51fcf243d942367a Mon Sep 17 00:00:00 2001 From: Philip Arthur Moore Date: Sun, 3 Feb 2013 02:03:40 -0500 Subject: [PATCH] _s: Add basic Infinite Scroll support. Fixes #107. Fixes #105. Props @ethitter. --- functions.php | 5 +++++ inc/jetpack.php | 18 ++++++++++++++++++ style.css | 15 +++++++++++++++ 3 files changed, 38 insertions(+) create mode 100644 inc/jetpack.php diff --git a/functions.php b/functions.php index dccdbc7..b6ab9e2 100644 --- a/functions.php +++ b/functions.php @@ -14,6 +14,11 @@ if ( ! isset( $content_width ) ) $content_width = 640; /* pixels */ +/* + * Load Jetpack compatibility file. + */ +require( get_template_directory() . '/inc/jetpack.php' ); + if ( ! function_exists( '_s_setup' ) ) : /** * Sets up theme defaults and registers support for various WordPress features. diff --git a/inc/jetpack.php b/inc/jetpack.php new file mode 100644 index 0000000..255e8a4 --- /dev/null +++ b/inc/jetpack.php @@ -0,0 +1,18 @@ + 'content', + 'footer' => 'page', + ) ); +} +add_action( 'after_setup_theme', '_s_infinite_scroll_init' ); diff --git a/style.css b/style.css index 20a181d..c1ba060 100644 --- a/style.css +++ b/style.css @@ -554,3 +554,18 @@ object { #searchsubmit { display: none; } + +/* =Infinite Scroll +----------------------------------------------- */ + +/* Globally hidden elements when Infinite Scroll is supported and in use. */ +.infinite-scroll #nav-above, /* Older / Newer Posts Navigation (always hidden) */ +.infinite-scroll #nav-below, +.infinite-scroll.neverending #colophon { /* Theme Footer (when set to scrolling) */ + display: none; +} + +/* When Infinite Scroll has reached its end we need to re-display elements that were hidden (via .neverending) before */ +.infinity-end.neverending #colophon { + display: block; +}