Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
WooCommerce change the number of products per row. You still have to write CSS so each of the products fit in there.
<?php
// change the number of products per row
add_filter( 'loop_shop_columns', 'patricks_loop_columns', 20 );
function patricks_loop_columns() {
return 5; // the number of products per row
}
// you still need to add CSS to make it look right. In Storefront you can add this to your style.css file.
// @media (min-width:768px){
// .products .product {
// max-width: 15%;
// }
// }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment