How to Declare WooCommerce Support in Your Theme

Here’s a handy PHP code snippet which allows you to declare WooCommerce support in your custom WordPress themes.

Quick Tip : How to Use WP-PageNavi With WooCommerce

All you need to do is copy the following code and paste it inside your functions.php file.

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

Source : http://docs.woothemes.com/document/declare-woocommerce-support-in-third-party-theme/

1 Comments

  1. 1)STEP 1
    Add this code in functions.php
    <?php

    remove_action( 'woocommerce_before_main_content', 'woocommerce_output_content_wrapper', 10);
    remove_action( 'woocommerce_after_main_content', 'woocommerce_output_content_wrapper_end', 10);

    add_action('woocommerce_before_main_content', 'my_theme_wrapper_start', 10);
    add_action('woocommerce_after_main_content', 'my_theme_wrapper_end', 10);

    function my_theme_wrapper_start() {
    echo '’;
    }

    function my_theme_wrapper_end() {
    echo ”;
    }

    add_action( ‘after_setup_theme’, ‘woocommerce_support’ );
    function woocommerce_support() {
    add_theme_support( ‘woocommerce’ );
    }

    2)STEP 2
    Copy & rename page.php as woocommerce.php in your theme

    3)STEP 3
    Replace Loop with

    Reply

Leave a Comment.