Created
May 1, 2017 20:25
-
-
Save BrookeDot/2346e8fd31429c1189a3fde77a12ad36 to your computer and use it in GitHub Desktop.
Jetpack's Infinite scroll to GPP Lookbook
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
// Current Jetpack.php file | |
/** | |
* Add theme support for Infinite Scroll. | |
* See: http://jetpack.me/support/infinite-scroll/ | |
*/ | |
function lookbook_jetpack_setup() { | |
add_theme_support( 'infinite-scroll', array( | |
'container' => 'main', | |
'footer' => 'page', | |
) ); | |
} | |
add_action( 'after_setup_theme', 'lookbook_jetpack_setup' ); | |
// my functions.php (or could be used in Jetpack.php | |
function brookedotphoto_setup() { | |
add_theme_support( 'infinite-scroll', array( | |
'type' => 'scroll', | |
'container' => 'content', | |
'wrapper' => false, | |
'footer' => 'page', | |
'footer_callback' => 'brookedotphoto_footer_text', | |
'posts_per_page' => 12, | |
) ); | |
//set higher priority than lookbook/inc/jetpack.php | |
add_action( 'after_setup_theme', 'brookedotphoto_setup',12 ); | |
// Added to js/vertical.js in the Custom Functions area to wrap Jetpack's on-load to display new images | |
$( document.body ).on( 'post-load', function () { | |
$( '.home:not(.page-template-default), .archive, .search, .page-template-page-sellmedia-php' ).find( '#content' ).each( function() { | |
new AnimOnScroll( $(this)[0], { | |
minDuration : 0.4, | |
maxDuration : 0.7, | |
viewportFactor : 0.2 | |
} ); | |
}); | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment