malinky / malinky-ajax-pagination

Wordpress Ajax Pagination
http://www.wordpress-ajax-pagination.com
12 stars 10 forks source link

Wordpress Ajax Pagination

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.

Download from the plugin directory.

There are 3 pagination types to choose from.

Set Up

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.

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

Styling Load More Button

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

 Custom Events

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

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

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();

Installation

Using the WordPress Dashboard

  1. Click 'Add New' in the plugins dashboard.
  2. Search for 'Ajax Pagination and Infinite Scroll'.
  3. Click 'Install Now'.
  4. Activate the plugin in the plugins dashboard.

Upload in the WordPress Dashboard

  1. Click 'Upload Plugin' in the plugins dashboard.
  2. Choose 'malinky-ajax-pagination.zip' from your computer.
  3. Click 'Install Now'.
  4. Activate the plugin in the plugins dashboard.

Upload With FTP

  1. Upload the 'malinky-ajax-pagination' folder to the '/wp-content/plugins/' directory
  2. Activate the plugin in the plugins dashboard.

Screenshots

  1. Admin screen.
  2. Click 'Add New' for multiple pagination settings.
  3. Navigate between multiple pagination settings.
  4. Delete pagination setting.

Changelog

2.0.0

1.3.0

1.2.1

1.2.0

1.1.1

1.1.0

1.0.0

Thanks

Thanks to qazbnm456 for the initial work on multiple pagination code.