Adding Hooks for compatibility with WooCommerce

Hi ATHEMES,

Could you help with providing guiding re: compatibility with WooCommerce.

They advise to add the following code to functions.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 '<section id="main">';
}

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

And change the classes and IDs to ensure the mark up is the same. Could you help in this respect? Thank you!!

Hi,

I guess you need to replace those two functions with this:


function my_theme_wrapper_start() {
   echo '<div id="primary" class="content-area col-md-9">';
      echo '<main id="main" class="post-wrap" role="main">';
}
function my_theme_wrapper_end() {
      echo '</main>';
  echo '</div>';
}

Please note that you should use a child theme for this. Also, we don’t handle plugin support.