Woocommerce Nested Categories

Hello,
Since updating X theme a few weeks ago, my woocommerce shop is no longer displaying nested categories properly. The first category is fine, but the second and subsequent categories only are showing 2 or three products per line. Any help would be most appreciated.
Website URL https://www.izway.com.au/wine/

I also had the follow custom code added to the website to display 5 products per row. I have removed it now, since the x theme update it was causing the products to display even more out of line than they currently are.

If you can help me out with updated CSS that would be fantastic

.woocommerce .products li.product {
width: 16.8%;
margin-right: 4%;
}

.woocommerce li.product.first {
clear: none;
}

.woocommerce .products li.product:nth-child(5n+5) {
margin-right: 0;
}

@media (max-width: 480px) {
.woocommerce .products li.product {
width: 48%;
margin-right: 4%;
}

.woocommerce .products li.product:nth-child(2n) {
    margin-right: 0;
}

}

Hi @spacebunyip,

Thanks for reaching out.

Your code is still working but you need to override the default theme CSS by adding !important to your width. To fix your issue, please update your CSS code to this one:

.woocommerce .products li.product {
width: 16.8% !important;
margin-right: 4%;
}

.woocommerce li.product.first {
clear: none;
}

.woocommerce .products li.product:nth-child(5n+5) {
margin-right: 0;
}

@media (max-width: 480px) {
	.woocommerce .products li.product {
	width: 48% !important;
	margin-right: 4%;
	}

	.woocommerce .products li.product:nth-child(2n) {
	    margin-right: 0;
	}
}

Please note that custom CSS code is outside the scope of our support. Issues that might arise from the use of custom CSS code and further enhancements should be directed to a third-party developer or you can avail One where we can answer questions outside of the features of our theme.

Hope that helps.

Thank you.

Thank you!
Worked perfectly. So happy that was such a simple fix.

No problem…glad you’re all sorted, @spacebunyip! :slight_smile:

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