Skip to content

Instantly share code, notes, and snippets.

@kloon
Created February 14, 2013 07:28
Show Gist options
  • Save kloon/4951136 to your computer and use it in GitHub Desktop.
Save kloon/4951136 to your computer and use it in GitHub Desktop.
WooCommerce Shelflife do not show sidebar on single product pages
<?php
remove_action( 'woo_main_after', 'woocommerce_get_sidebar', 10 );
add_action( 'woo_main_after', 'woo_custom_sidebar', 10 );
function woo_custom_sidebar() {
if ( ! is_product() ) {
woocommerce_get_sidebar();
}
}
remove_action( 'woocommerce_before_main_content', 'shelflife_before_content', 10 );
add_action( 'woocommerce_before_main_content', 'woo_custom_before_content', 10 );
function woo_custom_before_content() {
?>
<!-- #content Starts -->
<?php woo_content_before(); ?>
<div id="content" class="col-full">
<?php
global $woo_options;
if ( $woo_options[ 'woo_breadcrumbs_show' ] == 'true' ) {
woo_breadcrumbs();
}
?>
<!-- #main Starts -->
<?php woo_main_before(); ?>
<?php if ( ! is_product() ) { ?>
<div id="main" class="col-left">
<?php } else { ?>
<div id="main" class="fullwidth">
<?php } ?>
<?php
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment