Adding WooCommerce to a Custom Theme – not working

enter image description here

I have a custom WordPress theme I’m doing for a client and I need to make it woo-commerce compatible.

I’ve followed the steps on the woocommerce docs which are:

1) create a woocommerce.php file

2) copy in my standard page.php file and replace the loop with

3) Add the following to my functions.php file:

// WOO COMMERCE COMPATIBILITY
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 '<section id="main">';
}

function my_theme_wrapper_end() {
  echo '</section>';
}

However it isn’t working. I’m just getting the standard loop still with random data pulled in and the word ‘shop’ added (image attached). This is actually what also happens when I don’t do any of the above, but just activate woocommerce, so basically nothing changes.

I’ve starting to think is there some sort of standard shortcode function I need to add to my functions.php, to allow all shortcodes to work, because it looks like it’s not pulling in the shortcode into the page? I’ve attached an image of what I’m seeing.

It’s on a localhost site so I can’t provide a link.

Any ideas / suggestions very welcome.

Read more here:: Adding WooCommerce to a Custom Theme – not working

Leave a Reply

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