The SearchWP extension provides additional functionality for returning SearchWP query results to Ajax Load More for infinite scrolling.

This extension is available users running Ajax Load More 2.13+ and SearchWP 2.6.1+.


How It Works

The extension works by using the alm_query_args filter to provide a connection point between Ajax Load More and SearchWP.

By utilizing the alm_query_args filter you are able pass a search parameters to the SWP_Query class for search results then send the returned data back to Ajax Load More for display.

Implementation Steps

Step 1: Add Filter

Add the following Ajax Load More filter to your functions.php file – this filter will hook directly into the SearchWP extension for search results.

Step 2: Template and Shortcode

In search.php or a custom template, create a shortcode with unique ID and pass the search term to Ajax Load More using the search parameter.

Pro Tip: Set post_type=”any” in your shortcode to return all post types.