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

Results being displayed in "Recent Posts" Widget

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Results being displayed in "Recent Posts" Widget

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #11733
    brubble51abrubble51a
    Participant

    Hi,

    When I perform a search the results appear on the WooCommerce product page as well as in the recent posts widget (or/and in WC Sale widget).

    I have tested with the twenty fifteen theme (see attached file) and disabled other plugins – same results.

    I do not think I was having this problem before the latest WooCommerce up-date, but I am not sure.

    Thanks
    Grant

    #11735
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Hi,

    This is a known issue, related to the latest wp versions and the last plugin update. Basically the plugin accidentally overrides other queries if it’s not distinguishable from search.

    To temporarily fix it, you will have to change one of the plugin files. Open up the wp-content\plugins\ajax-search-pro\includes\classes\filters\class-asp-searchoverride.php file and change lines 24-26 from this:

    [php]if (!isset($wp_query->query_vars[‘s’])) {
    return $posts;
    }[/php]

    to this:

    [php]if (!$wp_query->is_main_query() || !isset($wp_query->query_vars[‘s’]) || !isset($_GET[‘s’]) ) {
    return $posts;
    }[/php]

    This should do the trick.

    If you need help with this, then feel free to provide temporary FTP details and I will do it for you.

    #11749
    brubble51abrubble51a
    Participant

    Thanks.
    Seems to have done the trick.

    Grant

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.