Update:
When I changed the shortcode to: [event_search_form], now the ajax is working. It inserts the search results into my main page template where I have added:
<div class="em-search-wrapper">
<div class="em-search-ajax">
</div>
</div>
I am curious if this will interfere in cases when the search form is also included in the page, or if the ajax function just targets the first “.em-search-ajax” class that it finds.
EDIT:
Yes it works! I just had to add the “.em-search-ajax” class to my theme’s ‘post_class’ function. Now the ajax replaces whatever content is in the page with the search results. “.em-search-wrapper” is not necessary.
In functions.php:
function em_search_post_class($classes) {
$classes[] = 'em-search-ajax';
return $classes;
}
add_filter('post_class', 'em_search_post_class');