Custom Taxonomy shared across Custom Post Types?

[ad_1]

I have a project where it is required that I have five custom post types. To keep thing simple let us pretend I only have two post types. Let us call them **post type A** and **post type B**.

For PTA I need a taxonomy with two categories. Let us call them cars and bikes.
For PTB I need another taxonomy with two more categories; cars and bikes again.

When I am in the archive page of PTA I want to be able to filter for cars and bikes of PTA only.
When I am in the archive page of PTB I want to be able to filter for cars and bikes of PTB only.

So far so good.

What confuses me is in the homepage I need to have two options for cars and bikes. When I click on either, I should be able to see cars or bikes (depending on what I’ve clicked on) from both PTA and PTB.

I tried to create a custom taxonomy for both PTA & PTB, but when I loaded everything in Gutenberg, I see nothing on the front end. In fact, I don’t see no preview of the three taxonomies in the Gutenberg editor either.

I have created everything with CPT UI. Sorry, I don’t have a shareable link. I am only working on localhost for now.

What is it I have done wrong here? Is this a good approach? Am I missing something significant? Please advise.

[ad_2]
2 Comments
  1. I use Meta Box Views for such things. It gives me maximum flexibility, as I can use WordPress functions inside it. But it has a learning curve. Toolset could do it, too, and is a little easier.

    I don’t have experience with doing such query loops in Gutenberg, sorry. You might try another block collections that has query loops. Sometimes, you won’t see a good preview of the loop inside Gutenberg. You must save the page and open it.

  2. Filtering an archive by more than one taxonomy requires a complex query that I usually deliver with a plugin. [example.com/inventory/make/toyota/make/bmw/type/car]) Is possible if you use custom rewrite rules and custom queries, but this isn’t drag and drop stuff.

    Search & Filter Pro is a $20 solution to this, otherwise hire a developer.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer