I have been working on this for days and have found many similar questions posted, but none that address my issue entirely.

I have two custom post types (argentine_recipes and international_recipes) that share the same wp categories (not custom taxonomies, just regular categories). This doesn’t seem too uncommon so far.

My custom post type archive and single posts are working fine.

So…

mysite.com/argentine_recipes/
mysite.com/argentine_recipes/my-arg-recipe

and…

mysite.com/iternational_recipes/
mysite.com/iternational_recipes/my-int-recipe

…have the URL structure and content that I want.

The problem lies with the CATEGORY archives.

With the help of this forum and other Google results, I’ve managed to use WP_query to create a page template that only outputs posts in a certain post type with a given category assigned. So I can filter out international_recipe posts when viewing the “desserts” category within the argentine_recipe section of the site.

However, I can’t figure out the URL structures or slugs for this filtered category archive. The page slug is appended directly after the home/ and the slug name that I want conflicts with the automated category archive page (which I also have a use for, so I can’t just modify that).

Here is what I want the final URL structure to look like:

mysite.com/all-recipes/desserts //automated category archive
mysite.com/argentine_recipes/desserts //filtered category archive A
mysite.com/internatinal_recipes/desserts //filtered category archive B

But this is what I have:

mysite.com/all-recipes/desserts //automated category archive

mysite.com/desserts-page //filtered category archive A

mysite.com/desserts-page2 //filtered category archive B

(obviously I’m also running into the problem that I need two separate templates with separate names for each view of the category).

There is a very good possibility that I am approaching this whole thing in the wrong way so I am open to any suggestions even if that means starting over (but let’s hope it doesn’t!).

This is the stackexchange post that helped me create the filter templates:

http://stackoverflow.com/questions/10647875/cant-filter-on-category-in-loop-when-using-custom-post-type-in-wordpress

Thank you!!

Read more here: Can I have two URL structures for a shared category’s archive pages filtered by two custom post types?


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.

Related Wordpress search:

, , , , , , , , ,

Wordpress related questions and answers: