9

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).

3
  • wanted to answer my own question q&a style, but wpse won't let me...
    – Ewout
    Mar 10, 2013 at 12:09
  • Any error messages when you try to answer? Maybe there's a reputation threshold and you'll need to wait a couple of hours. But, please, come back later and do it :)
    – brasofilo
    Mar 10, 2013 at 12:43
  • Good find. I was just configuring a theme to work with WooCommerce yesterday and can't believe I missed that add_theme_support() idea. Though you can also just dismiss the notice and it will go away permanently. Mar 10, 2013 at 13:17

2 Answers 2

15

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!

9

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');
}
4
  • This post is 3 years old (☉_☉)
    – Jebble
    Jun 14, 2016 at 10:08
  • 2
    ...It's now 6 years old, and still useful for reference ;)
    – fish_r
    Jun 19, 2019 at 23:57
  • And yet it still can break your theme big time Feb 24, 2021 at 15:40
  • @fish_r make that 8 -- to the day ! Mar 10, 2021 at 14:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.