This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

Override default WP search result does NOT work when using an Elementor template

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Override default WP search result does NOT work when using an Elementor template

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #25266
    danielecelsa07danielecelsa07
    Participant

    Hi,

    I see that if I set an archive template on Elementor for Search Results pages, Ajax Search Pro does not override the default results even if I flag the ‘Override default WP search result’ option.

    I need the Elementor template for Search Results pages because the layout must be similar to the one used in other pages, so I cannot use the layout options from Ajax Search Pro.

    Is there a way to use an archive template for Search Results pages, but still enabling the logic and behavior of the Ajax Search Pro searching?

    Thanks in advance,
    Daniele

    #25272
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Hi,

    Recently a similar issue was reported, it only occured once so far. There was a problem with the detection of the query, and I had to directly modify one of the files.

    For now, you should be able to resolve it via a small custom code snippet, until the next release is out. Try adding this custom code to the functions.php in your theme/child theme directory. Before editing, please make sure to have a full site back-up just in case!

    add_filter('asp_query_is_search', 'asp_query_is_search_override', 10, 2);
    function asp_query_is_search_override( $is_search, $wp_query ) {
    	return method_exists($wp_query, 'is_search') && $wp_query->is_search();
    }
    #25275
    danielecelsa07danielecelsa07
    Participant

    Great!! It worked! 🙂

    Just to know, when the new release will be out?

    Thanks a lot Ernest!
    Daniele

    #25276
    danielecelsa07danielecelsa07
    Participant

    You cannot access this content.

    #25277
    Ernest MarcinkoErnest Marcinko
    Keymaster

    It should be out later this week 🙂 It is almost done with development.

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Override default WP search result does NOT work when using an Elementor template’ is closed to new replies.