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_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.


alm_query_args_[id]

The alm_query_args_() 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.