When registering a custom taxonomy with the WP Theme Converter, there does not seem to be the option to enable archives, like there is when registering a custom post type.
What’s the best way to enable archives for custom taxonomies created with the Theme Converter?
Hello Chris,
Generally speaking, If the option you are looking for is not available from the Pinegrow / Pinegrow Theme Converter UI, you will have to proceed differently (by adding a code snippet in functions.php for example).
For example, you can use the excellent generator here https://generatewp.com/taxonomy/ to create custom taxonomies with exhaustive configuration settings.
However, thanks for your suggestion, the Pinegrow Development team is now informed about your question.
note: please be aware that this is by no means a guarantee of future integration.
I realised in the end that I did not need to register an archive, but rather create the template file:
archive-{taxonomy}.php
In my case, this template file is archive-events.php (my custom post type is named “events”).
On the archive-events.php template, I then attached the Show Posts Smart Action to the appropriate part of the template, and set the Loop type to custom query. I then set the Post type to my custom post type (events).
From there, I converted the Smart Action into regular WordPress settings. I then entered the following settings as the Taxonomy parameters:
To summarise:
My custom post type is named events
A custom taxonomy (called “location”) has been registered for the events custom post type.
The above settings ensure that if someone visits /location/{location-name}/ e.g /location/london/, the template only shows events that have had the custom taxonomy of London added to them.
If anyone else has a question around this, feel free to reply.
@465media I have converted my Smart Action into regular WordPress actions. If you do this, it will show the additional options that I have shared in the screenshot above. See if that helps, and if not send over the settings that you have entered and I will have another look.
Blockquote However it does appear in the quick edit screen on the wp-admin/edit.php?post_type=our_work See screenshot https://www.screencast.com/t/8njH029Cd5
My template works fine for the archive-our_work.php and as your suggestion I changed this to archive-work_type.php and still no results found. Frustrating.