Popular Categories

How to enable WooCommerce Support for your custom theme?

WooCommerce is an open source eCommerce platform built for WordPress and is one of the most extensively used plugin. When building themes from scratch as coders you do need to add the support to the theme. For this purpose, the snippet below can be used.

function mytheme_add_woocommerce_support() {
	add_theme_support( 'woocommerce' );
	add_theme_support( 'wc-product-gallery-zoom' );
	add_theme_support( 'wc-product-gallery-lightbox' );
	add_theme_support( 'wc-product-gallery-slider' );
} 
add_action( 'after_setup_theme', 'mytheme_add_woocommerce_support' );

Where to add this snippet?
You can place PHP snippets at the bottom of your theme in functions.php file.

Was this helpful?
Did I missed something? Do you have a question? Get in touch.