Created
October 28, 2015 16:32
-
-
Save ryelle/c9027d3efd9f271c16c0 to your computer and use it in GitHub Desktop.
Jetpack For Developers: Infinite Scroll example
This file contains hidden or 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
| <?php | |
| function prefix_jetpack_setup(){ | |
| add_theme_support( 'infinite-scroll', array( | |
| 'type' => 'click', | |
| 'container' => 'main', | |
| 'posts_per_page' => 12, | |
| 'footer' => 'page', | |
| 'render' => 'prefix_is_render', | |
| ) ); | |
| } | |
| function prefix_is_render() { | |
| // Only needed if your loop is different than | |
| while( have_posts() ) : the_post(); | |
| get_template_part( 'content', get_post_format() ); | |
| endwhile; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment