WordPress.org

Ready to get started?Download WordPress

Forums

Jetpack by WordPress.com
[resolved] Implementing Infinite Scroll (7 posts)

  1. Nickk356
    Member
    Posted 1 year ago #

    I am running a free theme - Launch and I really need the Infinite Scroll feature, but I don't know how to implement it (I'm not that great with coding :()! I tried changing the num. of posts in the "General Settings" to, say, 100 posts, but the site becomes much too slow, and I don't like the "Older Posts" links.

    What I have done so far is insert this code into the functions.php:

    add_theme_support( 'infinite-scroll', array(
    	'container'  => 'content',
    	'footer'     => 'page',
    ) );

    I'm really not sure how to get it working, been messing around for hours, doesn't work!
    --

    Website: http://doodlie.me
    Theme: http://www.themezilla.com/themes/launch

    http://wordpress.org/extend/plugins/jetpack/

  2. Nickk356
    Member
    Posted 1 year ago #

    Update:

    I have changed the original code from the above to this:

    /*Infinite Scroll*/
    add_theme_support( 'infinite-scroll', array(
    	'container'  => 'primary',
    	'footer'     => 'footer',
    ) );

    I can see the Jetpack's footer loading when scrolling down, but when I arrive to the bottom of the page, the loading circle does not load the next array of posts :(

  3. Christopher Finke
    Design Engineer at Automattic
    Plugin Author

    Posted 1 year ago #

    It looks like the Launch theme uses some different-than-expected content-*.php files, so this should mostly work:

    function launch_render_infinite_scroll() {
    	while ( have_posts() ) {
    		the_post();
    
    		$post_format = get_post_format();
    
    		get_template_part( $post_format ? 'content-post-' . $post_format : 'content-post-standard' );
    	}
    }
    
    add_theme_support( 'infinite-scroll', array(
    	'container' => 'primary',
    	'footer'    => 'footer',
    	'wrapper'   => false,
    	'render'    => 'launch_render_infinite_scroll',
    ) );

    You may want to use Custom CSS to hide .page-navigation, because it's not in its own container, so it stays visible above the newly loaded posts.

  4. Nickk356
    Member
    Posted 1 year ago #

    Thanks much, Infinite Scroll works now! But I have another problem - when it loads the next set of posts, the font changes and the little icons representing the type of post disappear. Just go to doodlie.me to see a working example...

    P.S. The Fixed Sidebar stops scrolling too :(

  5. Christopher Finke
    Design Engineer at Automattic
    Plugin Author

    Posted 1 year ago #

    At this point, it's probably best to request assistance from the theme author (http://www.themezilla.com/support/); I may be able to improve it marginally, but they would be able to offer a complete implementation.

  6. Nickk356
    Member
    Posted 1 year ago #

    Thanks much anyway ;)

  7. Christopher Finke
    Design Engineer at Automattic
    Plugin Author

    Posted 1 year ago #

    I'm going to mark this thread resolved in the interest of managing the support forum, not because I think that I've fixed everything you asked about, but because I think you have the information you need to get it fixed by the right people.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic