The following Ajax Load More filter hooks are available to support the modification of query arguments or insert content within the HTML output of the plugin.


alm_after_container

This filter is used to add content or HTML after the Ajax Load More container.


alm_before_button

This filter is used to add content before the load more .alm-button-wrap button container.


alm_before_container

This filter is used to add content or HTML before the Ajax Load More container.


alm_button_label

This filter is used to modify the default ‘Older Posts’ text on the Ajax Load More button.


alm_debug

This filter is used to display the entire Ajax Load More WP_Query result in the browser console. Debug data will be returned in a debug entry of the returned JSON object.


alm_js_dependencies

This filter is used to remove the jQuery dependancy of Ajax Load More.

When is this filter useful?

This filter is useful for users who may have jQuery bundled into a another script and do not directly require this dependancy.

Note: jQuery is still required for Ajax Load More to function, this filter simply removes the enqueue_script dependancy.


alm_query_args_{id}

The alm_query_args_{id}() filter can be used to modify WP_Query arguments by a specific Ajax Load More instance ID.

The following snippet would be pasted in your theme’s functions.php file.

This filter requires the following 2 step process:

  1. Set Unique ID – Ceate a unique ID for your ALM instance by setting a value for the id parameter in the shortcode.
    [ajax_load_more id="your_id"]
  2. Add Filter – Create the custom filter and function for this instance by appending the unique ID to the filter name.
    add_filter(‘alm_query_args_your_id’, ‘my_function_name’);

When is this filter useful?

This filter is useful for advanced users who prefer to write custom queries over working with shortcode parameters.

Note: Never modify the offset or paged query parameters – these parameters must be set within the core plugin or results may be undesired.


alm_modify_query_args

This filter is used to modify the Ajax Load More WP_Query arguments.

Note: This filter was deprecated in Ajax Load More 2.13.0 – please use the alm_query_args filter.