Two Products per Row on Phones
Shows shop and category pages in two columns on phones instead of one long single column, so shoppers see more products without scrolling.
Opens WPIDE on
Code
@media (max-width: 768px) {
.woocommerce ul.products[class*="columns-"] li.product,
.woocommerce-page ul.products[class*="columns-"] li.product {
width: 48%;
float: left;
clear: none;
margin: 0 4% 1.5em 0;
}
.woocommerce ul.products[class*="columns-"] li.product:nth-child(2n),
.woocommerce-page ul.products[class*="columns-"] li.product:nth-child(2n) {
margin-right: 0;
}
.woocommerce ul.products[class*="columns-"] li.product:nth-child(2n+1),
.woocommerce-page ul.products[class*="columns-"] li.product:nth-child(2n+1) {
clear: both;
}
.woocommerce ul.products li.product .button {
padding: .6em .8em;
font-size: .85em;
}
}
Notes
For classic WooCommerce templates; block themes set columns in the Product Collection block settings.
How to add this snippet
- Install WPIDE on your WordPress site (it is free) and open Code Snippets.
- Use snippet above adds it from the library in one click. Or copy the code into a new snippet with the same code type.
- It is added inactive: review the code and settings, then switch it on.