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 WhatsApp Conversation Widget

By Common Ninja

WhatsApp ConversationTry 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.

WhatsApp Conversation for Wordpress logo

WhatsApp Conversation

Show WhatsApp conversations on your website in a clear, authentic chat format.

3D Cards for Wordpress logo

3D Cards

3D cards that highlight important information with depth and motion, capture attention instantly, and help visitors navigate content more effectively.

Process for Wordpress logo

Process

Use a process widget to present tasks in a clear visual sequence, showing each step with images and text to improve understanding and user engagement.

World Clock for Wordpress logo

World Clock

Display multiple time zones with a world clock widget that offers clear global times, customizable styles, and a responsive design for better user experience.

Video Poll for Wordpress logo

Video Poll

Create interactive video polls that use engaging clips to boost participation, gather insights, and help visitors vote in a more dynamic way.

Mastodon Feed for Wordpress logo

Mastodon Feed

Show Mastodon posts in a live Mastodon feed that keeps content fresh, strengthens your social presence, and helps visitors engage with your updates.

Countdown Bar for Wordpress logo

Countdown Bar

Add a countdown bar to your site to create urgency, highlight limited time offers, and drive faster engagement and higher conversions.

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.

Call Button for Wordpress logo

Call Button

Add a call button to your site so visitors can tap to start a phone call instantly, improving direct communication access.

Spinning Wheel for Wordpress logo

Spinning Wheel

Add an interactive spinning wheel to offer prizes, capture leads, and drive user engagement through gamified rewards.

TikTok Carousel for Wordpress logo

TikTok Carousel

Show TikTok videos with a TikTok carousel that arranges clips in a smooth, customizable layout to boost engagement and keep visitors watching.

Stop Motion Player for Wordpress logo

Stop Motion Player

Create engaging stop motion displays with a stop motion player that turns image sequences into interactive animations to boost creativity and visitor engagement.

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