Where do I download Ajax Load More?

Ajax Load More is available for download from the WordPress Plugin repository.

What are the steps to getting Ajax Load More to display on my website?

  1. Create your shortcode
  2. Add the shortcode to your page by adding it via the content editor or placing it directly within one of your template files.
  3. Load a page with your shortcode in place and watch Ajax Load More fetch your posts.

Pro Tip: Visit the Help section inside the Ajax Load More plugin for a visual implementation guide.

What are my server requirements?

Your server must be able to read/write/create files. Ajax Load More creates the default repeater on plugin activation and in order to modify the output it is required to write to the file as well.

Does Ajax Load More have any JavaScript dependencies?

Yes, Ajax Load More requires jQuery.

How are my repeater templates saved?

Repeater template data is saved into a custom table in your WordPress database as well as written directly to a repeater template (default.php) file within the ajax-load-more/core/repeater plugin directory.

How can I access custom fields in a repeater?

To access custom field values in a Repeater Template you must define global $post; at the top of the repeater and pass the $post->ID to the custom field function.

The example below illustrates how to access standard post meta fields as well as fields create with Advanced Custom Fields plugin.

 

Can I count posts within an Ajax Load More loop?

Yes, Ajax Load More provides various templates variables that are available for use within repeater templates. Please see the Variables section for more details.

Can I order posts by 'random'?

Yes, however not directly out of the box. Ordering by random requires a custom query to be run before the Ajax Load More shortcode – view  code sample.

Why are the post thumbnails an incorrect size in my Ajax Load More listing?

This issue appears most often because prior to activating Ajax Load More your theme was not resizing uploaded media to exactly 150×150 as required by the default repeater template.

When activated, Ajax Load More adds an image size of 150×150 (alm-thumbnail) to your theme so all future uploads will be resized into proper dimensions for display.

If updating the default repeater to use an image size already in your theme is not an option we recommend using the Regenerate Thumbnails plugin to batch process your previously uploaded media library images.

Note: Don’t forget to back up your site prior to running the thumbnail regeneration process.

Why are my custom JavaScript click events are not working in repeater templates?

To trigger click events on dynamically created content you need to make use of the jQuery .on() event handler.

How can I restore the default repeater template?

Copy and paste the template below into your repeater template.

Can Ajax Load More infinite scroll single posts?

Yes, with the help of the Previous Post add-on.

Can I activate my add-on license on a development/localhost and production website?

Yes, you can activate your license on both instances, however your development/localhost website must follow one of the following domain patterns.

  • localhost
  • 10.0.0.0/8
  • 172.16.0.0/12
  • 192.168.0.0/16
  • *.dev
  • .*local
  • dev.*

How can I remove the alm-thumbnail image size?

You can remove the alm-thumbnail image size by adding the following snippet to your functions.php.

How can I hide the 'Load More' button when no posts remain?

When zero posts remain in an Ajax Load More query the Load More button will receive a class of done – you can target this element with CSS to hide the button.

I'm getting a '$ is not a function' error when using the callback functions

If you are getting the $ is not a function error in any of the callback functions, try replacing the $(function() wrapper with the following: