woocommerce support in wordpress theme not working

admin

Administrator
Staff member
I am a beginner in
Code:
wordpress
and I tried all the ways but I cannot make my theme
Code:
woocommerce
supportable. Below is my page.php

<blockquote>
page.php
</blockquote>

Code:
&lt;?php
/**
 * The template for displaying pages
 *
 * This is the template that displays all pages by default.
 * Please note that this is the WordPress construct of pages and that
 * other "pages" on your WordPress site will use a different template.
 *
 */
?&gt;
&lt;?php get_header(); ?&gt;
    &lt;div class="col-lg-12 col-md-12 col-sm-12 col-xs-12"&gt;
        &lt;div class="page"&gt;
            &lt;?php if ( have_posts() ) : ?&gt;
            &lt;?php while( have_posts() ) : the_post(); ?&gt;

                &lt;div class="post"&gt;
                    &lt;h3 class="&lt;?php post_class(); ?&gt;" id="post-&lt;?php the_ID(); ?&gt;"&gt;&lt;?php the_title(); ?&gt;&lt;/h3&gt;
                    &lt;div class="entry-content"&gt;
                        &lt;?php the_content(); ?&gt;
                    &lt;/div&gt;
                    &lt;?php
                        // If comments are open or we have at least one comment, load up the comment template.
                        if ( comments_open() || get_comments_number() ) {
                            comments_template();
                        }
                    ?&gt;
                &lt;/div&gt;

            &lt;?php endwhile; ?&gt;
            &lt;?php endif; ?&gt;
        &lt;/div&gt;
    &lt;/div&gt;

&lt;?php get_footer(); ?&gt;

At first I duplicate
Code:
page.php
and create
Code:
woocommerce.php
and upload to server, but it fails, below is my
Code:
woocommerce.php

<blockquote>
woocommerce.php
</blockquote>

Code:
&lt;?php
/**
 * The template for displaying pages
 *
 * This is the template that displays all pages by default.
 * Please note that this is the WordPress construct of pages and that
 * other "pages" on your WordPress site will use a different template.
 *
 */
?&gt;


&lt;?php get_header(); ?&gt;
    &lt;div class="col-lg-12 col-md-12 col-sm-12 col-xs-12"&gt;
        &lt;div class="page"&gt;
            &lt;?php woocommerce_content(); ?&gt;
        &lt;/div&gt;
    &lt;/div&gt;
&lt;?php get_footer(); ?&gt;

But it fails, after this I deleted
Code:
woocommerce.php
from server and edited my
Code:
functions.php
file to add woocommerce supportable code. Below is the code I added in my
Code:
functions.php
file.

Code:
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 '&lt;div class="col-lg-12 col-md-12 col-sm-12 col-xs-12"&gt;&lt;div class="page"&gt;';
}

function my_theme_wrapper_end() {
  echo '&lt;/div&gt;&lt;/div&gt;';
}

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

but it also fails, you can see the output <a href="http://www.enterhelix.com/shan/wordpress4.5/shop/" rel="nofollow">here</a>

If you see in debugger you can see that no woocommerce css file has been loaded.

Please help me with your suggestion. Thank you.