I created a custom taxonomy with Metabox. Now, I need archive templates for a taxonomy term and the taxonomy itself. While it seems straightforward to create a Bricks template for a taxonomy term, an archive for the taxonomy itself always results in a 404.
Here is an example of what I did:
Created a taxonomy “location” and added terms “beach”, “city”, “mountains”.
I know I can simply create a template for the terms of the taxonomy with the following steps:
Create a new template and set its type to “Archive”. Then set its condition to Archive/Categories & Tags/All Terms (location). That works!
How do I need to define a template to access the upper slug, example.com/location?
This should be an archive, too. But I did not find any condition that met. The purpose is to show an overview of all possible terms in that taxonomy.
Hi - a few thoughts, but no outright solution that I’m aware of…
I just got done with a whole site framework using MB CPTs, Taxos and Custom Fields. Getting the slugs right was the hardest part, by far. By the time I got them working the way I wanted, I had had to basically strip my site down to almost nothing, start with a fresh install.
I started with a fresh install of WP, Bricks (& Child), core plugins (MetaBox +1 or 2 other unrelated)
Next, create the custom CPTs via metabox. Make sure you make notes of all settings and have everything ready to go beforehand; subsequent updates to CTPs seems to lead to bugs 90% of the time. Each CPT you should walk through the wizard once and add it, and be done with it. Pay particular attention to your URL slugs here
Then do your custom taxonomies if you have any, and custom fields last, followed by linking them all together via MB admin
Now, hop over to Bricks and create an archive and page template for each of your CPTs. Just set up the template condition, don’t worry about the slugs being correct
Now go fill a few sample pages\posts in your CPTs
You should now have something workable
Be careful where you set slugs… there’s tons of add-ins, features and various places to control this, but it’s highly fundemental and should only be set at very specific points. For me, this was in the MB CPT setup for most things. My “top level pages” (non-bricks-templated, static pages) slugs are handled via the WP QuickEdit. Archive slugs are handled via MB’s CPT slug, NOT via the Bricks template slug setting.
Also note that cache can be a huge headache. Disable any cache plugins while doing this work, and open the WP Settings → Permalink page to flush the WP slug cache (you don’t have to edit anything, just open it).
Only when I did all those things did more core url structure fall in line in a way I was comfortable with. Build the rest of your site out from there.