Hi,
I have created several Custom Taxonomies for Woocommerce Product. An example of the Taxonomy I have created is "coffee_region" with an example Term "ethiopia"
Out of the box, I am able to display the Term Archive page which uses Woocommerce archive-product.php template. It basically listed out all my products with the Term "ethiopia"
For a clearer idea of my objectives, I will list them below:
1) Create a Taxonomy Archive page - ie for the Taxonomy "coffee_region" which lists out all the Terms
2) Customize the 'coffee_region' Taxonomy and Term Archive pages separately from the other Archive pages.
- I will post this as a separate ticket later after we have resolved objective 1
I am using PHP instead of Layout/Wordpress Archive to achieve this because I only want to add minor changes to the templates rather than starting up from scratch.
For objective 1, I have been referring to https://toolset.com/documentation/customizing-sites-using-php/creating-taxonomy-term-archives/.
As I want my archive pages to look like woocommerce archive, I have used archive-product.php as my starting point.
This is what I have done so far:
1) Copy archive-product.php to the folder mychildtheme/woocommerce
2) Rename to taxonomy-coffee-region.php
However, this has not been giving me the result I hoped for. The mysite.com/coffee-region only returned the 404 error. Am I missing something here? I have tried moving the php file to mychildtheme main folder but it was negative as well.
Thank you in advance
Dear James,
It is expected result, you will see same 404 error in wordpress built-in taxonomy "category", for example URL:
hidden link
In your case, I suggest you try these:
1) Create a view, query terms of taxonomy "coffee_region"
and display the term's archive page
2) Create a wordpress page, for example, "coffee_region page",
display above view
Use the wordpress page of step 2) as the "Taxonomy Archive page" you mentioned above
Thanks Luo Yang for the suggestion.
I guess it is much simpler to compile a view of Terms on a Page.
Cheers,
James