woo commerce custom sidebar
-
Hi, I am having problems calling my custom shop sidebar into my shop pages (so shop and category archives as well as product pages). At the moment these pages display the Blog Sidebar which I will be using for my posts page. I thought the best way would be to register my shop sidebar and then call it in sidebar.php with a conditional tag. I registered the sidebar (sidebar-6) and populated it with widgets but I can’t figure out how to call it in sidebar.php. This is what I have at the moment, and results in no sidebars showing an any pages.
if ( ! is_active_sidebar( ‘sidebar-1’ ) ) {
return;}
?>
<aside id=”secondary” class=”widget-area” role=”complementary” aria-label=”<?php esc_attr_e( ‘Blog Sidebar’, ‘twentyseventeen’ ); ?>”>
<?php dynamic_sidebar( ‘sidebar-1’ ); ?>
</aside><!– #secondary –>
<?phpif ( is_woocommerce() ) : {
return;}?>
<aside id=”secondary” class=”widget-area” role=”complementary” aria-label=”<?php esc_attr_e( ‘Shop Sidebar’, ‘twentyseventeen’ ); ?>”>
<?php dynamic_sidebar( ‘sidebar-6’ ); ?>
</aside><!– #secondary –>Can you provide any advice at all on how to achieve this? Many thanks.
The page I need help with: [log in to see the link]
- The topic ‘woo commerce custom sidebar’ is closed to new replies.