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 Image Grid Slider Widget

By Common Ninja

Image Grid SliderTry 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.

Image Grid Slider for Wordpress logo

Image Grid Slider

Showcase visuals with an image grid slider that blends a grid layout and carousel motion to create a dynamic, customizable, mobile friendly display.

Wake Up Notifications for Wordpress logo

Wake Up Notifications

Use wake up notifications to re engage visitors with custom alerts that capture attention, boost interaction, and help increase conversions across your site.

Sticky Video for Wordpress logo

Sticky Video

Use a sticky video that stays visible while users scroll to keep content in view, increase watch time, and boost engagement.

Tabs for Wordpress logo

Tabs

Use tabs to organize content into clear sections, improve navigation, and help visitors switch between topics quickly for a smoother user experience.

Tumblr Feed for Wordpress logo

Tumblr Feed

Show Tumblr posts with a Tumblr feed that keeps content fresh, improves navigation, and helps visitors discover more posts.

Restaurant Menu List for Wordpress logo

Restaurant Menu List

Create a clear restaurant menu list that helps visitors explore dishes easily, understand key details, and make confident ordering decisions that support conversions.

Accordion for Wordpress logo

Accordion

Add collapsible content sections to your site to organize information and help users navigate content more efficiently.

Vimeo Carousel for Wordpress logo

Vimeo Carousel

Show Vimeo videos with a Vimeo carousel that displays clips in a smooth, flexible layout to boost visibility and engagement.

Flip Cards for Wordpress logo

Flip Cards

Use flip cards to present information interactively, improve visual design, and guide visitors toward clearer decisions that support conversions.

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.

Progress Bars for Wordpress logo

Progress Bars

Show progress clearly with animated progress bars that visualize goals, highlight achievements, and keep visitors engaged and motivated.

eBay Reviews for Wordpress logo

eBay Reviews

Show eBay reviews to build trust, strengthen credibility, and help visitors make confident purchase decisions that support higher sales.

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