How to declare WooCommerce support in your theme

I have built my own theme, which integrates quite well with WooCommerce, but I want to know how to properly get rid of the notification on top of my theme that said my theme didn’t support WooCommerce / properly declare support (going a bit further than just clicking away the message).

Related posts

Leave a Reply

2 comments

  1. Digging into the code that generates the notification (current_theme_supports('woocommerce')) gives the answer: place add_theme_support( 'woocommerce' ); in your functions.php

    simple!

  2. Add below code in function.php file of your current theme.

    add_action( 'after_setup_theme', 'setup_woocommerce_support' );
    
     function setup_woocommerce_support()
    {
      add_theme_support('woocommerce');
    }