Support » Theme: Storefront » How to create a custom sidebar?

Viewing 4 replies - 1 through 4 (of 4 total)
  • AddWeb Solution Pvt. Ltd.


    Hello justin007h,

    You can create custom sidebar with plugin or with coding.
    with plugin to create sidebar please refer following

    and with coding you can follow below code:-

    Add this code into functions.php in order to register your custom sidebar:

    function my_custom_sidebar() {
            array (
                'name' => __( 'Custom', 'your-theme-domain' ),
                'id' => 'custom-side-bar',
                'description' => __( 'Custom Sidebar', 'your-theme-domain' ),
                'before_widget' => '<div class="widget-content">',
                'after_widget' => "</div>",
                'before_title' => '<h3 class="widget-title">',
                'after_title' => '</h3>',
    add_action( 'widgets_init', 'my_custom_sidebar' );

    I want to render the custom sidebar in single posts only, so I’ll edit the “Single post” file in single.php

    <?php if ( is_active_sidebar( 'custom-side-bar' ) ) : ?>
        <?php dynamic_sidebar( 'custom-side-bar' ); ?>
    <?php endif; ?>

    Go to Appearance > Widgets to see if the new sidebar available.
    Add the widgets you need.

    or try the following steps:-
    1) Click on Appearance > Customize
    2) Then go to WooCommerce > Product Catalog
    3) Select “show subcategories” from Category Display
    4) Click on Save Changes

    Hope this will help you.



    Automattic Happiness Engineer

    Hi there,

    I just wanted to reach out and see if you were able to get this sorted?

    We have a sidebar widget that you might want to take a look at, although it doesn’t display the subcategories of the exact page you’re on at the moment:

    There are also plugins on that *may* do the trick like this one:

    Though the tricky part is the interactive piece and showing live time. This might require further customizations:

    Let us know if you were able to get this sorted!

    Hello, I was still not able to figure this one out. I believe “how to create a custom side bar” isn’t the right question. I have added a better image of what i am trying to accomplish. On this website when i go to the “footwear” page it only shows the sub categories for footwear such as shoes and when i go to the “shoes” page it only shows the subcategories for shoes on the sidebar.




    Automattic Happiness Engineer

    @justin007h so you’d like to only show the submenu items once the category is clicked. As @laceyrod already indicated, we don’t have an easy solution for that and customization might be in order.

    Given that there haven’t been updates on this thread in a while, we’ll mark this as resolved.

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.