Skip to content

Instantly share code, notes, and snippets.

@robin-scott
Created September 3, 2018 10:45
Show Gist options
  • Save robin-scott/ed1249d57063c547294a6933b833141e to your computer and use it in GitHub Desktop.
Save robin-scott/ed1249d57063c547294a6933b833141e to your computer and use it in GitHub Desktop.
Declare WooCommerce Support (With settings)
// Originally posted in official WooCommerce Github
// Re-posted by Robin Scott of Silicon Dales here https://silicondales.com/tutorials/woocommerce/declare-woocommerce-support-theme/ to aid understanding and benefit all in the Open Source community. Feel free to share are distribute as required!
function mytheme_add_woocommerce_support() {
add_theme_support( 'woocommerce', array(
'thumbnail_image_width' => 150,
'single_image_width' => 300,
'product_grid' => array(
'default_rows' => 3,
'min_rows' => 2,
'max_rows' => 8,
'default_columns' => 4,
'min_columns' => 2,
'max_columns' => 5,
),
) );
}
add_action( 'after_setup_theme', 'mytheme_add_woocommerce_support' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment