I would like to create permalink to a search for a custom post type that has 2 taxonomies in it. Here are a few appropriate examples:
/root/%taxonomyA%/%taxonomyB%
/root/%taxonomyA%/taxonomyB/%taxonomyB%
Taxonomy B can be inside any number of Taxonomy As.
I already have something for this structure that works great:
/root/%taxonomyA%/%customPostType%
Is this possible? I prefer the 1st example, but I would be fine with the 2nd.
I did attempt to put this rewrite rule in, but I don't get the matches I expect in the rewrite inspector.
add_rewrite_rule(
'^root/([^/]+)/taxonomyB/([^/]+)',
'index.php?post_type=customPostType&taxonomyA=$matches[1]&taxonomyB=$matches[2]',
'top'
);
When I put in root/A/taxonomyB/B
the inspector, it comes up as attachment: B