Ajax Pagination and Infinite Scroll

Ajax Pagination and Infinite Scroll

Wordpress plugin

Install on Wordpress

App Details

Load paged content with Ajax throughout your WordPress site. The plugin works on posts, pages, search, custom post types and WooCommerce. Paginate MULTIPLE sets of posts in the same template.

Take a look at the demo site.

We’re looking for websites that use the plugin to feature on a showcase page. If you’re interested please email a link to your website to [email protected].

There are 3 pagination types to choose from.

  • Infinite Scroll – Automatically load new posts when the user reaches the bottom of the screen.
  • Load More Button – Click to load new posts.
  • Pagination – Normal pagination but load the next page with Ajax.

Set Up

  • For additional help watch this video.
  • Once the plugin is installed navigate to Settings -> Ajax Pagination Settings.
  • Select an applicable theme default. If your theme isn’t listed then add the correct selectors.
  • There are 4 required selectors which can be found by using your browser developer tools.
  • ‘Posts Selector’ The selector that wraps all of the posts/products.
  • ‘Post Selector’ The selector of an individual post/product.
  • ‘Navigation Selector’ The selector of the post/product navigation.
  • ‘Next Selector’ The selector of the navigation next link.
  • Choose a pagination type.
  • Add an optional callback.
  • Click ‘Save Changes’.

Multiple Settings

If for example your site is running WooCommerce and also a Blog then the two templates will probably use different selectors and require a different set up from the admin settings.

  • Click ‘Add New’ at the top of the screen.
  • Repeat the set up steps above and click ‘Save Changes’.
  • At the top of the screen you can navigate between your saved settings.

Multiple Sets of Posts

It’s possible to query and display multiple sets of posts in the same template and independently paginate them. This requires a specific set up within the template file which has been outlined here.

Delete Setting

  • At the top of the screen select the pagination setting you wish to delete.
  • Scroll to the bottom of the screen and click ‘Delete’.

Styling Load More Button

  • The load more button is wrapped in a div with the css class .malinky-load-more and the button has the css class .malinky-load-more__button.
  • Style these in your themes style.css file.

Initialization (Setup)

The plugin is initialized when the page first loads and the pagination is then updated to use Ajax. If you need to reinitialize the plugin at anytime call the folowing function in your javascript.

MalinkyAjaxPaging.setUp(); 

This is useful if you run any other javascript / ajax on the page, for example filtering on an ecommerce site.

Callback

  • Add your own Javascript code in the settings which runs after each new set of posts are loaded.
  • Callback receives two parameters: loadedPosts (An array of the new posts) and url (The url that was loaded).

Custom Events

There are 3 custom events that are triggered. Bind to these events to perform your own actions.

  • malinkyPaginationInitialized. Triggered after initialization.

    document.addEventListener('malinkyPaginationInitialized', function(e) { console.log('PaginationInitialized'); }); 
  • malinkyLoadPostsStart. Triggered before new posts are loaded.

    document.addEventListener('malinkyLoadPostsStart', function(e) { console.log('LoadPostsStart'); }); 
  • malinkyLoadPostsComplete. Triggered after new posts are loaded.

    document.addEventListener('malinkyLoadPostsComplete', function(e) { console.log('LoadPostsComplete'); }); 
  • Events only function when using a single set of pagination on a page.

Isotope / Masonry

If your using an isotope / masonry layout then you’ll need to add a callback in the settings to layout the new posts when they are added. This should be in the following format.

$('.grid').isotope('reloadItems').isotope(); 

Change the reference to the class name .grid to your own container element.

Additional

  • If using infinite scroll there is an option to amend the buffer in pixels before the next set of posts are loaded.
  • If using load more button there is an option to amend the button text.
  • You can choose your own preloader.gif.
  • When using pagination the browser history is maintained allowing your visitors to use the browser back and forward buttons as expected.

Conditional Loading

By default the plugin loads on every page load. You can stop loading the Javascript and CSS by setting the following constants to false in your wp-config.php file.

define('MALINKY_LOAD_JS', false); define('MALINKY_LOAD_CSS', false); 

Or by adding these two lines to your functions.php

add_filter( 'malinky_load_js', '__return_false' ); add_filter( 'malinky_load_css', '__return_false' ); 

Once disabled you can load the Javascript and CSS in specific templates by adding the following before the wp_head().

global $malinky_ajax_pagination; $malinky_ajax_pagination->malinky_ajax_pagination_styles(); $malinky_ajax_pagination->malinky_ajax_pagination_scripts(); 

Pricing

Starting from $0 per month.

Check Out the Vimeo Feed Widget

By Common Ninja

Vimeo FeedTry For Free!

App Info

Rating

Reviewers

27 reviews

Tags

admin
ajax
ajax pagination
back
custom post types

Developed By

craigramsay

Quick & Easy

Find the Best Wordpress plugins for you

Common Ninja has a large selection of powerful Wordpress plugins that are easy to use, fully customizable, mobile-friendly and rich with features — so be sure to check them out!

Testimonial

Testimonial plugins for Wordpress

Galleries

Galleries plugins for Wordpress

SEO

SEO plugins for Wordpress

Contact Form

Contact Form plugins for Wordpress

Forms

Forms plugins for Wordpress

Social Feeds

Social Feeds plugins for Wordpress

Social Sharing

Social Sharing plugins for Wordpress

Events Calendar

Events Calendar plugins for Wordpress

Sliders

Sliders plugins for Wordpress

Analytics

Analytics plugins for Wordpress

Reviews

Reviews plugins for Wordpress

Comments

Comments plugins for Wordpress

Portfolio

Portfolio plugins for Wordpress

Maps

Maps plugins for Wordpress

Security

Security plugins for Wordpress

Translation

Translation plugins for Wordpress

Ads

Ads plugins for Wordpress

Video Player

Video Player plugins for Wordpress

Music Player

Music Player plugins for Wordpress

Backup

Backup plugins for Wordpress

Privacy

Privacy plugins for Wordpress

Optimize

Optimize plugins for Wordpress

Chat

Chat plugins for Wordpress

Countdown

Countdown plugins for Wordpress

Email Marketing

Email Marketing plugins for Wordpress

Tabs

Tabs plugins for Wordpress

Membership

Membership plugins for Wordpress

popup

popup plugins for Wordpress

SiteMap

SiteMap plugins for Wordpress

Payment

Payment plugins for Wordpress

Coming Soon

Coming Soon plugins for Wordpress

Ecommerce

Ecommerce plugins for Wordpress

Customer Support

Customer Support plugins for Wordpress

Inventory

Inventory plugins for Wordpress

Video Player

Video Player plugins for Wordpress

Testimonials

Testimonials plugins for Wordpress

Tabs

Tabs plugins for Wordpress

Social Sharing

Social Sharing plugins for Wordpress

Social Feeds

Social Feeds plugins for Wordpress

Slider

Slider plugins for Wordpress

Reviews

Reviews plugins for Wordpress

Portfolio

Portfolio plugins for Wordpress

Membership

Membership plugins for Wordpress

Forms

Forms plugins for Wordpress

Events Calendar

Events Calendar plugins for Wordpress

Contact

Contact plugins for Wordpress

Comments

Comments plugins for Wordpress

Analytics

Analytics plugins for Wordpress

Common Ninja Apps

Some of the best Common Ninja plugins for Wordpress

Browse our extensive collection of compatible plugins, and easily embed them on any website, blog, online store, e-commerce platform, or site builder.

Vimeo Feed for Wordpress logo

Vimeo Feed

Show Vimeo videos in a Vimeo feed that keeps content fresh and helps visitors discover more of your video library.

Restaurant Menu Flip Cards for Wordpress logo

Restaurant Menu Flip Cards

Present dishes with restaurant menu flip cards that highlight key details, help visitors explore options easily, and support confident ordering decisions.

Instagram Slider for Wordpress logo

Instagram Slider

Add an Instagram slider to your site to display social posts dynamically and keep your visual content engaging and current.

YouTube Carousel for Wordpress logo

YouTube Carousel

Show YouTube videos with a YouTube carousel that displays clips in a smooth, customizable layout to boost visibility and keep visitors engaged.

Vimeo Slider for Wordpress logo

Vimeo Slider

Show Vimeo videos with a Vimeo slider that displays clips in a smooth slider to boost engagement and keep visitors watching.

Trust Badges for Wordpress logo

Trust Badges

Show trust badges that highlight security and reliability, build customer confidence, and help visitors feel safe making purchases on your site.

Cookie Banner for Wordpress logo

Cookie Banner

Use a Cookie Banner to inform visitors about cookies on your site and let them manage their consent in a clear, structured way.

Charts & Graphs for Wordpress logo

Charts & Graphs

Add charts and graphs to your site to present data clearly, help visitors understand insights faster, and support more confident decision making.

Comparison Tables for Wordpress logo

Comparison Tables

Add comparison tables to your site to help visitors evaluate features side by side, understand differences quickly, and choose the right option with confidence.

Info List for Wordpress logo

Info List

An Info List presents key details in a clear, structured format to improve user experience and support conversions.

Job Application Form for Wordpress logo

Job Application Form

Collect candidate information with a job application form that organizes submissions, streamlines hiring, and helps you manage applicants efficiently.

Reddit Feed for Wordpress logo

Reddit Feed

Show Reddit posts with a Reddit feed that updates automatically, improves content discovery, and keeps visitors engaged with fresh discussions.

More plugins

plugins You Might Like

Discover Apps By Platform

Discover the best apps for your website

WordPress
Wix
Shopify
Weebly
Webflow
Joomla
PrestaShop
Shift4Shop
WebsiteX5
MODX
Opencart
NopCommerce

Common Ninja Search Engine

The Common Ninja Search Engine platform helps website builders find the best site widgets, apps, plugins, tools, add-ons, and extensions! Compatible with all major website building platforms - big or small - and updated regularly, our Search Engine tool provides you with the business tools your site needs!

Multiple platforms