Last active
January 1, 2016 12:09
-
-
Save zeropointdevelopment/8142780 to your computer and use it in GitHub Desktop.
[WordPress] Code from our blog post Using the Infinite Scroll Module in JetPack - http://www.limecanvas.com/using-the-infinite-scroll-module-in-jetpack/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Add support for JetPack infinite scroll | |
**/ | |
add_theme_support( 'infinite-scroll', array( | |
'container' => 'content', | |
'footer' => 'page', | |
) | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Add theme support for infinite scroll | |
* | |
* @uses add_theme_support | |
* @action after_setup_theme | |
* @return null | |
*/ | |
function twenty_twelve_infinite_scroll_init() { | |
add_theme_support( 'infinite-scroll', array( | |
'container' => 'content' | |
) ); | |
} | |
add_action( 'after_setup_theme', 'twenty_twelve_infinite_scroll_init' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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' ); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Infinite Scroll */ | |
/* Hides navigation links and site footer when infinite scroll is active */ | |
body .infinite-scroll .navigation, | |
body .infinite-scroll.neverending #footer { | |
display: none; | |
} | |
/* Shows the footer again in case all posts have been loaded */ | |
body .infinity-end.neverending #footer { | |
display: block; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Infinite Scroll - footer content */ | |
#infinite-footer .container{ | |
width: 960px !important; | |
background-color: #a9cf38; | |
border-top: 1px solid #7f9c2a; | |
color: #fff; | |
} | |
#infinite-footer .container a{ | |
color: #fff; | |
} | |
#infinite-footer .container a:hover{ | |
text-decoration: underline; | |
color: #fff; | |
} | |
/* Inifnite Scroll - Spinner */ | |
.infinite-loader{ | |
color: #929292; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment