How To Enable WooCommerce Support For Your Theme

There’s lots of reasons to add Woocommerce support to your theme. As Woocommerce is one of the most widely used eCommerce systems in the world and most certainly for WordPress, it’s important to get this working with whatever theme you might be using. In general, you’ll only need to follow these steps for free themes or the ones that come with WordPress like Twenty Twenty, Twenty Nineteen, Twenty Eighteen, or Twenty Seventeen.

Why Add WooCommerce Support To Your Theme

If you want to customize the layout of your default Woocommerce pages, you’ll need to add support to your theme. If you want to move some fields around, move the price to a different area, or any thing else that might be related to layout – you’ll need to overwrite the template PHP files.

Overwriting the files is a simple process, just copy the base files and directories over to your theme. However, if you’ve done this and you’re not seeing any changes, it’s because your theme does not support Woocommerce.

How To Enable WooCommerce Support For Your Theme

If you’ve copied over the files and directories to your theme but aren’t seeing any changes or you just want to add Woocommerce support, add this code to your theme functions.php file:

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

If you haven’t moved over the directory structure, here’s what it should look like.

You will only need to add the “woocommerce” folder and then follow the directory structure from the plugin for only the files you are changing. Don’t completely copy everything in the plugin folder.

If you’re not clear on where to get the directory structure and files, they live at /wp-content/plugins/woocommerce/templates/COPY THE STUFF IN HERE. Make sure you don’t include the “templates” folder.

Leave a Reply

Your email address will not be published. Required fields are marked *