# Tune Jetpack Infinite Scroll

> Sets how many posts Jetpack's Infinite Scroll loads at a time and switches it to a "Load more" button, which is friendlier to footers and keyboard users than endless scrolling.

- Type: PHP
- Runs: Run everywhere
- Category: [Plugin Integrations](https://wpide.com/library/category/integrations/)
- Tags: jetpack, infinite-scroll, archives
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/jetpack-infinite-scroll-settings/

## Code

```php
$wpide_posts = 9;       // Posts per load.
$wpide_type  = 'click'; // click = "Load more" button, scroll = automatic.

add_filter( 'infinite_scroll_settings', function ( $settings ) use ( $wpide_posts, $wpide_type ) {
    if ( is_array( $settings ) ) {
        $settings['posts_per_page'] = max( 1, (int) $wpide_posts );
        $settings['type']           = 'scroll' === $wpide_type ? 'scroll' : 'click';
    }

    return $settings;
} );
```

## Notes

Your theme must support Infinite Scroll. Set $wpide_type to scroll to keep automatic loading.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Tune Jetpack Infinite Scroll" in its snippet library and add it in one click; or create a new PHP snippet in WPIDE (or any code snippets plugin) and paste the code above. More snippets: https://wpide.com/library/
