WordPress.org

Ready to get started?Download WordPress

Forums

Advance WP Query Search Filter
[resolved] Search String not Working (8 posts)

  1. in omnia paratus
    Member
    Posted 1 year ago #

    Hi there.

    I'm having a problem with the search itself.
    I have two dropdown fields that get their info from two taxonomies, and a imput text field.

    for ex.: in the text field i write: "Chocolate" in the dropdown filters I select "London" (one of the taxonomies) knowing that "chocolate" shouldn't appear on "London". It gives me the result the same (but belonging to another taxonomy/filter option) instead of saying that there isn't any results.

    Every time I write something in the text string, somehow the plugin ignores the taxonomies filter. How can I fix this?

    Thank you so much in advance

    http://wordpress.org/extend/plugins/advance-wp-query-search-filter/

  2. TC.K
    Member
    Plugin Author

    Posted 1 year ago #

    Hi,
    This is the natural of the plugin to ignore taxonomy and meta field when the text field is in use.

  3. in omnia paratus
    Member
    Posted 1 year ago #

    hummm.... and how do I do the opposite? can this plugin do it? if not, what is the best one around?

    I really need to have the text string working with the filters.

  4. TC.K
    Member
    Plugin Author

    Posted 1 year ago #

    Well, if you really need this, then you'll have to edit the plugin.

  5. in omnia paratus
    Member
    Posted 1 year ago #

    Do you have any idea of the code that I need to add?

  6. TC.K
    Member
    Plugin Author

    Posted 1 year ago #

    Ok,
    open plugin folder/includes/process.php

    look for line 145 to line 146

    $tax_query = isset($get_tax) && empty($keyword) ? 	$get_tax : null;
    $meta_query = isset($get_meta) && empty($keyword) ? $get_meta : null;

    change to

    $tax_query = isset($get_tax)  ? $get_tax : null;
    $meta_query = isset($get_meta) ? $get_meta : null;

    I never test this, but it should work.

  7. in omnia paratus
    Member
    Posted 1 year ago #

    Wow! it worked like a charm! thank you so much for your help. :-))))

    Cheers

  8. in omnia paratus
    Member
    Posted 1 year ago #

    P.S.: keep up with the good work

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic