Skip to content

Instantly share code, notes, and snippets.

@coenjacobs
Created February 15, 2014 22:39
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save coenjacobs/9026180 to your computer and use it in GitHub Desktop.
Save coenjacobs/9026180 to your computer and use it in GitHub Desktop.
Change the number of columns in which products will be shown on product archives
<?php
add_filter( 'loop_shop_columns', 'wc_loop_shop_columns', 1, 10 );
/*
* Return a new number of maximum columns for shop archives
* @param int Original value
* @return int New number of columns
*/
function wc_loop_shop_columns( $number_columns ) {
return 2;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment