WordPress.org

Ready to get started?Download WordPress

Forums

Query Multiple Taxonomies
Why the default search widget don't work? (8 posts)

  1. simonkain
    Member
    Posted 4 years ago #

    Hello
    I'm not very good with php... but i need some help here (if possible..)

    The default sintax of the search widget query is like this

    /s=keyword

    i notice that with that query the plugin dont work and there is a message of Nothing Found.

    but if i use directly the kind of query that the plugin suggest it work perfectly

    ?genre=jazz&artist=Chet+Baker

    my question is easy
    How is possible to make the search widget to generate a query like ?genre=jazz&artist=Chet+Baker

    instead of the /s= ?

    thanks you very much for the help

  2. scribu
    Member
    Plugin Author

    Posted 4 years ago #

    How is possible to make the search widget to generate a query like ?genre=jazz&artist=Chet+Baker

    You basically have to write a new widget.

    Before you do that, download the development version of QMT and check out the dropdown option in the Drill-Down widget.

    By the way, it's not a good idea to try to use a single text input. You should have a separate one for each taxonomy.

  3. simonkain
    Member
    Posted 4 years ago #

    ok you are right
    what is not good to handle taxonomies with a single text input

    i'm tryng the dev version but i get an error

    when open the widget:

    Warning: Invalid argument supplied for foreach() in C:\Program Files\EasyPHP5.2.10\www\wordpress3\wp-content\plugins\query-multiple-taxonomies\widget.php on line 96

    when selecting the post type:

    Warning: in_array() [function.in-array]: Wrong datatype for second argument in C:\Program Files\EasyPHP5.2.10\www\wordpress3\wp-content\plugins\query-multiple-taxonomies\widget.php on line 101

    so, can you do something about it?

    i notice also that the drop down menu do not iterate all the taxonomies but only the first...

    when this plugin will be finished, it will be one of the best pluging ever coded... it give so much control...

    btw... let's make a supposition...
    i have a custom post type named restourants. and 2 taxonomies for that custom type.... areas, and typology

    lets say that we have a record named "Blackhorse dinner" with an area and a typology..

    the best thing to do for a user that might want to search about it

    is to write in the input field "restaurant area1 typology2"
    that should return al restourant post type matching the two taxonomies

    how is possible to achive that?

    thanks for your passion...

  4. simonkain
    Member
    Posted 4 years ago #

    I notice another thing

    when in the drill down menu we got the li links and the +
    the link interate all the post with that taxonomy, and the + generate the complex query...

    if we have many custom post type that share a common taxonomy, we need to be able to use it as an option so that the link will generate the query as well instead of directly go to the taxonomy archive.

    is possible to achive that easly? within the plugin code?

    thanks you very much

  5. scribu
    Member
    Plugin Author

    Posted 4 years ago #

    i'm tryng the dev version but i get an error

    Try re-adding the widget to the sidebar.

    if we have many custom post type that share a common taxonomy, we need to be able to use it as an option so that the link will generate the query as well instead of directly go to the taxonomy archive.

    I don't understand. Could you give an example?

  6. simonkain
    Member
    Posted 4 years ago #

    yes now work

    #1 but i dont understand why the dev version is not creating the query...
    point directly to the taxonomy address which is not comprehensive of the category in the query

    #2 if i have a custom type post named "restaurants" and another named "beauty center" and i have a taxonomy named "city areas"

    i would like to use it for both the custom posts

    if we have a shared taxonomy the drill down links will point in a wrong address

    understand?

  7. scribu
    Member
    Plugin Author

    Posted 4 years ago #

    if we have a shared taxonomy the drill down links will point in a wrong address

    How so? The URLs are post type agnostic.

    If I'm still not getting it, please provide example URLs.

    #1 but i dont understand why the dev version is not creating the query...
    point directly to the taxonomy address which is not comprehensive of the category in the query

    Again, please give an actual example.

  8. Sadhas
    Member
    Posted 3 years ago #

    Maybe it will just help if someone can explain to me how the built in WordPress function works. But here's what I want:

    * Two search fields, by name and by location
    * The first field should check all the common post data (only posts) + categories (like normal search ?s=xxx)
    * The second field should only check on the taxonomy filed
    * Only one field needs to be filled

    If it is possible, can you please give me a hint on where to start?

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic