Site logo

Archived topic

Custom Taxonomy Archive

7 replies · Started by Raul on July 26, 2019

Viewing posts 1–8 of 8

Hi,
I am testing a custom taxonomy (art_series) that is linked to WooCommerce Products. The taxonomy uses ACF to include a single field (series_years) and an image (series_image).

Is there an easy way of creating a template to display terms in this taxonomy including each image and single fields? Should I start from the archive.php template of is there a taxonomy template? What should be the right permalink to access this template?

I first tried creating a new page with an element to display all terms in the custom taxonomy, but I am not sure if I can use this method to display the ACF fields as well.

Any help would be much appreciated!

Thanks for your quick reply.

What I need is to show in a grid all taxonomy terms with an image and year. The images are defined with ACF image field and the year is a ACF simple text.

I have listed all terms of my custom taxonomies here:
http://35.232.201.230/~suzanne2/test/art-projects-by-suzanne-anker/

And have created 2 copies of the archive.php and renamed as: taxonomy-classification.php and taxonomy-art_series.php, based on the slugs of custom taxonomies. Didn't modify any code from the original yet.

Then two problems arise:

  1. If the taxonomy archive template exists, the product thumbnails are not shown when looking at each taxonomy term page. See here: https://www.dropbox.com/sh/nfyse837d23nej4/AAB8zn2VJ-gYOI5_oYqx0Quja?dl=0
  2. I don't know how to display a general taxonomy archive. For example, in art_series taxonomy I want to show the main taxonomy terms in a grid with an ACF image field for each one, similarly to the way single products are shown here http://35.232.201.230/~suzanne2/test/product-category/artworks/

I found this about WP and taxonomy archives: https://wordpress.stackexchange.com/questions/48435/get-term-archive-url-link

Not sure what I am doing wrong, perhaps the URL might be the problem.

Any suggestion?

Hi there,

This really depends on the code in your templates. Are you adding the necessary code to display a featured image for example?

This kind of stuff is hard to support in the forum, unfortunately, as it's not directly related to GP.

For the URL, it should be something like this:

https://yoursite.co/your-taxonomy-slug/your-term-name/

Thanks Tom,

Yes, I understand this is not GP related. Will try to solve it without creating a taxonomy.php template.

The URL you suggest works by default using the archive.php because is for a specific taxonomy term, but what I want to show is the full archive of terms from that taxonomy.

Thanks Tom,

For anyone else with the same question, finally I decided to use child product categories instead of a custom taxonomy. All my artwork products are now categorized with an "artwork series" name, and used a shortcut [product_categories number="999" parent="16"]to display all series directly via the archive.php. Therefore I don't need to create a custom taxonomy template (I tried multiple options and didn't behave the way I wanted)

Glad you got something working :)

This archived topic is closed to new replies.