Skip to content

Instantly share code, notes, and snippets.

@Spirecool
Last active April 21, 2021 10:15
Show Gist options
  • Save Spirecool/3a6664b1dbe753827399c9dfbffaf749 to your computer and use it in GitHub Desktop.
Save Spirecool/3a6664b1dbe753827399c9dfbffaf749 to your computer and use it in GitHub Desktop.
<?php
* Change number or products per row to 3
*/
add_filter('loop_shop_columns', 'loop_columns', 999);
if (!function_exists('loop_columns')) {
function loop_columns() {
return 3; // 3 products per row
}
}
SHORTCODE
Use the WooCommerce shortcodes on your archive page.
[recent_products per_page="12" columns="5"] will display the products in rows of 5 columns.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment