• Resolved SDN

    (@susan-ideology)


    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 –>
    <?php

    if ( 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]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter SDN

    (@susan-ideology)

    apologies this is the correct page link
    http://79.170.40.172/wgandf.co.uk/?product_cat=ceramics

    Susan, congratulations, the site is amazing. Very Beautiful. You really customize the theme.
    Regards, Ramiro.

    Thread Starter SDN

    (@susan-ideology)

    Someone else kindly provided the answer to this, so am posting it here in case it is of interest to others. the code goes in sidebar.php
    if ( is_woocommerce() && is_active_sidebar( ‘sidebar-6’ ) ) :?>
    <aside id=”secondary” class=”widget-area” role=”complementary”
    aria-label=”
    <?php esc_attr_e( ‘Shop Sidebar’, ‘twentyseventeen’ ); ?>”>
    <?php dynamic_sidebar( ‘sidebar-6’ ); ?>
    </aside><!– #secondary –>
    <?php

    elseif ( is_active_sidebar( ‘sidebar-1’ ) ) :
    ?>
    <aside id=”secondary” class=”widget-area” role=”complementary”
    aria-label=”<?php esc_attr_e( ‘Blog Sidebar’, ‘twentyseventeen’ ); ?>”>
    <?php dynamic_sidebar( ‘sidebar-1’ ); ?>
    </aside><!– #secondary –>
    <?php endif;

    ?>

    Thread Starter SDN

    (@susan-ideology)

    so this is now resolved!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘woo commerce custom sidebar’ is closed to new replies.