I've had a fair amount of experience with WP, but this continues to make issues and could be on the brief for my next website. I'm looking for a "good" way to accomplish this task;
- the post screen will have two custom taxonomies (tax-1 and tax-2)
- each custom taxonomy will have several terms
- the user can view posts by clicking on a link to a custom taxonomy archive, like www.domain.com/tax-1/term-1/
The catch is, the admin needs to be able to select two terms, one from each taxonomy. That posts needs to be found like this;
- www.domain.com/tax-1/term-1/
- www.domain.com/tax-2/term-2/
- www.domain.com/not-sure-what-taxonomy/term-1-and-term-1
As far as I know, WP generates a category archive for each category/term/tag or whatever, so how do I combine two (or more) into one page? What would the URL look like, and would I need to $wp_rewrite magic for this?
I've found you can do this sort of thing: www.domain.com/category/tag-1,tag-2, which is great, but I'd rather have something like "tag-1-tag-2" as the URL structure.
I'm aware some people may say this isn't a "real" question. I'm looking for an idea, or some info from someone who has done this, not a load of code! I simply don't understand how this part of WP/querying is made up, and would love a little more knowledge. Surely someone else has also had this issue?
Many thanks for your time, Dan.
tax_query
arguments forWP_Query
, thepre_get_posts
and theparse_query
filters and how to use callbacks on them.$_GET
variable in URL to build a custom query I suppose.