WordPress.org

Ready to get started?Download WordPress

Forums

Query Multiple Taxonomies
[resolved] Does it work with the search? (10 posts)

  1. bgajus
    Member
    Posted 3 years ago #

    Wasn't sure if this plugin works with the wordpress search.
    Here is what I'm trying to do:

    I have a custom post type "Movies."
    I have a custom taxonomy "Genres" (set up like categories) with terms such as Comedy, Drama, etc.

    I want to do a search for "Jim Carrey" but limit my search to only the Movie post type and only under the taxonomy term Comedy which falls under Genre.

    I've tried building a url query (http://www.site.com/?s=jim+carrey&post_type=movies&genre=comedy) but it doesn't seem to work. Does this plugin just not have anything to do with the search feature in wordpress?

  2. scribu
    Member
    Plugin Author

    Posted 3 years ago #

    It's working fine on my test install, using the development version (1.3-alpha7).

  3. bgajus
    Member
    Posted 3 years ago #

    when you do a search, it seems to be redirecting to the taxonomy.php template rather than using the search template. is that how that should work?

  4. scribu
    Member
    Plugin Author

    Posted 3 years ago #

    I'm not sure. What version are you using and what exactly is the query?

  5. bgajus
    Member
    Posted 3 years ago #

    the version that seems to work for me is 1.1
    I'm not really sure why the newer versions do not work since I'm just using the default wordpress theme twentyten with WP3.0. Unless I'm just completely using it wrong. The usage info confuses me a bit. I've tried the newest version with a taxonomy.php page but I don't get correct results. Still seems to be using WordPress's method of using just one of the taxonomies. Am I supposed to be building my query on the page? meaning is there a function i should be adding to the taxonomy.php page as well? I was under the impression that the plugin handled that by using GET and checking the url query ex:(?taxonomy=term&taxonomy2=term). Perhaps im just not doing all the correct steps to get the proper results. Regardless, yeah version 1.1 is what I'm using and it is forcing the search results to use the multitax.php page.

  6. scribu
    Member
    Plugin Author

    Posted 3 years ago #

    I was under the impression that the plugin handled that by using GET and checking the url query ex:(?taxonomy=term&taxonomy2=term).

    That is correct, sort of. It actually checks the query vars that are passed to WP_Query.

    Bottom line is that you don't have to call any special function in taxonomy.php.

  7. bgajus
    Member
    Posted 3 years ago #

    can you post a copy of a default taxonomy.php page so I can replace mine and see if it works then?

  8. bgajus
    Member
    Posted 3 years ago #

    come to think of it....something else that may help....since I'm using a plugin to create/register my custom post_types and taxonomies, perhaps I will disable that plugin and go back and manually register them. Do you have a recommended format for registering custom post_types and taxonomies?

  9. bgajus
    Member
    Posted 3 years ago #

    scribu,
    Just wanted to give you the heads up. When I disabled the CD CPT Tools plugin (plugin that gives you a web interface for creating post_types and taxonomies) and I manually registered the post_type and taxonomies, I started getting the correct results....with the newest version of your plugin. Also it doesn't appear to be redirecting searches to the taxonomy.php page which is another good thing. Two Thumbs Up!!!!

  10. scribu
    Member
    Plugin Author

    Posted 3 years ago #

    Good to hear you got to the bottom of it.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic