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 <?php woocommerce_content(); ?>

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

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.

1 Answer 1


You'll need to declare support for WooCommerce in your themes functions.php file:

function mytheme_add_woocommerce_support() {
    add_theme_support( 'woocommerce' );
add_action( 'after_setup_theme', 'mytheme_add_woocommerce_support' );

Hope this helps!

  • Thanks Matthew that did solve it. It's a shame the question got down-voted :(
    – pjk_ok
    Apr 9, 2018 at 23:44

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