If you're developing a theme from scratch or if you're using a theme that wasn't designed to work with WooCommerce, you may see a notice on your site when you install WooCommerce. The following screenshot displays the theme-incompatibility message:
This message can be easily dismissed by clicking on Hide this notice but, if you're planning on distributing this theme to others, then it's nice to let people know you designed your theme to work with WooCommerce.
You'll need to install a theme that shows the notice shown in the preceding screenshot. If your theme doesn't show this notice, then it's already declared support for WooCommerce and you can skip this recipe.
If you're a theme developer, you may have heard of Underscores. This starter theme hasn't declared support for WooCommerce, so if you base your theme on Underscores, you'll need to declare support. See the Underscores website for more information at http://underscores.me/.
Declaring that your theme supports WooCommerce takes a pretty small code snippet. We'll add that code snippet to your theme's functions.php
file and then we'll be done. In the following steps, we declare support for our WooCommerce theme:
functions.php
file in your code editor.functions.php
file:add_action( 'after_setup_theme', 'woocommerce_coobook_support' ); function woocommerce_coobook_support() { add_theme_support( 'woocommerce' ); }