Woocommerce product attribute archives

I want my product attribute archives to look much like my category archives. Some of them display perfectly, such as https://holeheartedldn.com/material/titanium/

Others, however, are full of images of all sizes and I’m not sure why

https://holeheartedldn.com/brand/qualiti/

https://holeheartedldn.com/length/10mm/

I’ve selected Global Content Layout in blog archives and I’ve tried uploading a copy of the product category archive template as taxonomy-pa_brand.php etc, but nothing seems to fix it

I’m using the X theme

Thanks In advance

Hi there,

Honestly, I am not sure how you set up your pages that is why I am not sure how I can be of a help. The first one which you gave the link is an archive page with this taxonomy:

Which seems to be a pretty standard search term like a taxonomy of Woocommerce.

The other 2 are using something different:

That file you have a customization is not generating correct necessary HTML classes to make the listing look like the first link.

Thank you.

Hey,

I’ve just realised the first is both an attribute and a tag, which explains why it’s using the tag archive template. Do you know what I’d need to do to make my attribute archives look like my tag and category archives?

Thanks

Hey @AyshBanaysh,

The product archive pages including product category and product tags will get their layout in Theme Options > WooCommerce > Shop. Their layout will be the same as the shop for consistency in design. Please remove your custom templates so we could see if there is a problem with X. Also give us access to your WordPress admin in a Secure Note so we could see your actual setup.

Thanks.

Hey, Product Category and Product Tag archives are displaying perfectly, it’s just attribute archives that are the problem. I’ve deleted my template and I’ve left a secure note on my original post.

Thanks

Hi There,

By default, we do have some customization on product category and product tag archives of woocommerce. Extra attribute is not included. You can see the customization on this file:
\wp-content\themes\x\woocommerce\loop\loop-start.php

On the last line on that file:
<ul class="products<?php echo $column_class; ?>">
The $column_class variable controls the number of columns. It is coming from Theme Options settings.

It is not working on those attributes because custom attributes is not included on the template customization. We do have two options here. First one is to create the brand template and then add the column class. Though this part is customization and it would be better to consult a developer if you are not familiar creating custom template. The second option, is we just target it using CSS. We will just copy how the default category works.
See this: https://screencast-o-matic.com/watch/cFV0nwo0e9
The cols-3 class holds the formatting. See how when I just add the class, the formatting change to what you wanted. Now, let’s add those formatting directly on the term classes. Try adding the following:

.woocommerce[class*="tax-"] li.product.first, .woocommerce[class*="term-"] li.product.first {
    clear: both;
}

.woocommerce[class*="tax-"] li.product, .woocommerce[class*="term-"] li.product {
    width: 30.66667%;
    float: left;
    overflow: hidden;
    position: relative;
    margin: 0 4% 4.5% 0;
    padding: 0;
    background-color: #fff;
    border-radius: 4px;
    box-shadow: 0 0.15em 0.35em 0 rgba(0,0,0,0.135);
}
.woocommerce[class*="tax-"] li.product.last,
.woocommerce[class*="term-"] li.product.last {
    margin-right: 0;
}

See this: https://screencast-o-matic.com/watch/cFV0nGo0fP
At the end of the screencast, I have remove the class cols-3 but the formatting stays the same as you wanted because I have copied column style directly on the available classes.

Further customization from here would be getting into custom development. Hope this helps.

Sorry for the delayed response. This worked perfectly and with your videos I think I actually understand what’s going on! Thank you so much for the response!

Glad that we could be of a help :slight_smile:

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.