WordPress.org

Forums

Advance WP Query Search Filter
Is there any way to combine taxonomy with string search? (7 posts)

  1. aholsteinson
    Member
    Posted 1 year ago #

    The plugin setting says that "when user using this to search, the taxonomy and custom meta filter that defined above will not be used", is there some way to make it work?

    Here is what I am trying to do: Have the categories as a radio button in the search form and the text input search box for searching within the selected category only.

    Right now I can only do one or the other. Either select a category or write a string and hit search. Can they be combined into a single search so that if I select the category 'Movies' (for example) and search for 'Inception' the results will be only from those posts that have the category 'Movies'?

    I wouldn't mind using separate post types instead of categories if that would make this possible.

    Thanks in advance!

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

  2. TC.K
    Member
    Plugin Author

    Posted 1 year ago #

    Yes, it can but need to customize the plugin core file, which is not a recommended way to do it. You can try my other plugin which have more expendable feature, which this feature can be done through a filter hook.

  3. aholsteinson
    Member
    Posted 1 year ago #

    Thanks for your responde. I am trying it now but the Ajax plugin seems to behave the same way, in that enabling String Search disables the taxonomy filter I create. :(

  4. TC.K
    Member
    Plugin Author

    Posted 1 year ago #

    That's plugin still need some modification in order to do what you want. I think I have answered this question somewhere in the forum.

  5. aholsteinson
    Member
    Posted 1 year ago #

    Thanks TC.K! appreciate the help, will look in the forums for the solution.

  6. cubicalab
    Member
    Posted 1 year ago #

    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 test this, and it works very nice!

  7. aholsteinson
    Member
    Posted 1 year ago #

    Thanks cubicalab! I will try that out.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Advance WP Query Search Filter
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags

No tags yet.