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

This topic contains 2 replies, has 2 voices, and was last updated by brubble51a brubble51a 5 years, 5 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #11733
    brubble51a
    brubble51a
    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

    Attachments:
    You must be logged in to view attached files.
    #11735
    Ernest Marcinko
    Ernest 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:

    if (!isset($wp_query->query_vars['s'])) {
        return $posts;
    }

    to this:

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

    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.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #11749
    brubble51a
    brubble51a
    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.