WP Manifestindependent plugin directory
manifest / utilities / mihdan-infinite-scroll

Mihdan: Infinite Scroll

Плагин под WordPress, реализующий бесконечную подгрузку записей (постов) на одиночных (single) страницах.

★ 12stars

Install

Download source zip No release zip yet

This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.

Install straight from GitHub with WP-CLI:

wp plugin install https://github.com/mihdan/mihdan-infinite-scroll/archive/refs/heads/master.zip
No built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.

Плагин под WordPress, реализующий бесконечную подгрузку записей (постов) на одиночных(single) страницах.

Плагине не работает на архивных (archive) страницах!

Конфигурация

add_filter(
    'mihdan_infinite_scroll_config',
    function( $config ) { 
        $config['container'] = '.articles',
        $config['append']    = '.article',

        return $config;
    }
);

События

$( '.articles' ).on(
    'append.infiniteScroll',
    function( event, response, path, items ) {
        // Делаем что-то.
    }
);

Список возможных событий

  • scrollThreshold.infiniteScroll
  • request.infiniteScroll
  • load.infiniteScroll
  • append.infiniteScroll
  • error.infiniteScroll
  • last.infiniteScroll
  • history.infiniteScroll

Более подробную информацию по событиями можно посмотреть на официальном сайте библиотеки Infinite Scroll.