Woocommerce Change Number of Columns for Specific Category

Hi,

I’m trying to center two products on a specific category page. One way is to change the number of columns for that category from 3 to 2. The main shop is set to 3 columns under Theme Options > Woocommerce. The category I’m trying to target is “diaper-service”. Alternately, I could use CSS to center the two products but I haven’t been able to figure out how to target that page by itself.

URL: https://happybabycheeks.ca

Your help would be appreciated. Thanks!

Hi there,

Please try this code in the Global CSS:

.term-diaper-service .products li {
    width: 48% !important;
}

.term-diaper-service .products li:nth-child(2n) {
    margin-right: 0;
}

.term-diaper-service .products li:nth-child(2n+1) {
    margin-right: 4%;
}

Here are some reference links related to the suggestions above:

Hope this helps.

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