Viewing 3 replies - 1 through 3 (of 3 total)
  • Theme Author Anthony Hortin

    (@ahortin)

    Thanks for the kind words.

    Probably the easiest way to do this is to duplicate sidebar.php and add this to your child theme.

    Edit this new file in your child theme and replace with the following…

    
    <?php
    /**
     * The Sidebar containing the main widget areas.
     *
     * @package Quark
     * @since Quark 1.0
     */
    ?>
    	<div class="col grid_4_of_12">
    
    		<div id="secondary" class="widget-area" role="complementary">
    			<?php
    			do_action( 'before_sidebar' );
    
    			if ( is_shop() ) {
    				if ( is_active_sidebar( 'sidebar-shop' ) ) {
    					dynamic_sidebar( 'sidebar-shop' );
    				}
    			}
    			else {
    				if ( is_active_sidebar( 'sidebar-main' ) ) {
    					dynamic_sidebar( 'sidebar-main' );
    				}
    
    				if ( ( is_home() || is_archive() ) && is_active_sidebar( 'sidebar-blog' ) ) {
    					dynamic_sidebar( 'sidebar-blog' );
    				}
    
    				if ( is_single() && is_active_sidebar( 'sidebar-single' ) ) {
    					dynamic_sidebar( 'sidebar-single' );
    				}
    
    				if ( is_page() && is_active_sidebar( 'sidebar-page' ) ) {
    					dynamic_sidebar( 'sidebar-page' );
    				}
    			}
    			?>
    
    		</div> <!-- /#secondary.widget-area -->
    
    	</div> <!-- /.col.grid_4_of_12 -->
    

    *In this new code (above), replace sidebar-shop (in 2 places) with the name of your sidebar that you created in your functions file.

    You should then see your new sidebar on your Shop page instead of the default sidebars.

    Thread Starter candyappledesign

    (@candyappledesign)

    That did it! Thank you very much for your help and again for a very versatile theme!

    Theme Author Anthony Hortin

    (@ahortin)

    You’re very welcome. Glad it helped ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Add custom sidebar WooCommerce’ is closed to new replies.