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.


How can I highlight the current search term with SearchWP?

Highlighting the current search term in your SearchWP results can be done using the following example in your Repeater Template.

The code sample above hooks directly into the core SearchWP Highlighter function to highlight the search term within the results.