Skip to content

Instantly share code, notes, and snippets.

@karrikas
Created January 11, 2016 14:01
Show Gist options
  • Save karrikas/adb4f108316e18ccf224 to your computer and use it in GitHub Desktop.
Save karrikas/adb4f108316e18ccf224 to your computer and use it in GitHub Desktop.
Woocommerce integracion in a theme
<?php
// remove plugin default integration
remove_action( 'woocommerce_before_main_content', 'woocommerce_output_content_wrapper', 10);
remove_action( 'woocommerce_after_main_content', 'woocommerce_output_content_wrapper_end', 10);
// disable breadcrumbs (optional)
remove_action( 'woocommerce_before_main_content','woocommerce_breadcrumb', 20, 0);
// add defatul shop layaout
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 '<div id="main" class="col-sm-8 clearfix" role="main">';
}
function my_theme_wrapper_end() {
echo '</div>';
}
add_action( 'after_setup_theme', 'woocommerce_support' );
function woocommerce_support() {
add_theme_support( 'woocommerce' );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment