Last active
July 19, 2017 18:58
-
-
Save BFTrick/968a192bf54627965146636159aefbe2 to your computer and use it in GitHub Desktop.
WooCommerce change the number of products per row. You still have to write CSS so each of the products fit in there.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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