Hi Guys,
Am working on a website and am trying to remove the sidebar on one page only, am using Genesis and Woocommerce plugin.
I have tried to comment out but no luck, I have tried doing a template still no luck. Here is the code I used to remove the sidebar on single product pages:
// NEW WIDGET AREA FOR SINGLE PRODUCT VIEW
if ( function_exists('register_sidebar') )
register_sidebar(array('name'=>'Single Product Sidebar',
'before_widget' => '<div class="widget-wrap">',
'after_widget' => '</div>',
'id' => 'product_sidebar',
'description' => 'Widgets in this area will be shown on the single product view page only.',
'before_title' => '<h4 class="widgettitle">',
'after_title' => '</h4>',
));
// content-single-product.php HOOK to get into the page to add single product sidebar.
add_action('woocommerce_after_single_product', 'single_product_sidebar_hook');
function single_product_sidebar_hook() { ?>
<?php remove_action('genesis_sidebar', 'genesis_do_sidebar'); ?>
<?php add_action('genesis_sidebar', 'genesis_single_product_sidebar');
function genesis_single_product_sidebar() { ?>
<?php // SINGLE PRODUCT VIEW SIDEBAR
if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Product_Sidebar') ) : ?>
<?php endif; ?>
<?php } ?>
<?php }
Here is the website:
http://womanshealthychef.com/catalogue
Thanks