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

    (@addweb-solution-pvt-ltd)

    Hello justin007h,

    You can create custom sidebar with plugin or with coding.
    with plugin to create sidebar please refer following https://themeisle.com/blog/custom-wordpress-sidebar/

    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() {
        register_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.
    thanks.

    laceyrod

    (@laceyrod)

    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: https://woocommerce.com/products/ajax-layered-navigation/

    There are also plugins on www.ads-software.com that *may* do the trick like this one: https://www.ads-software.com/plugins/yith-woocommerce-category-accordion/

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

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

    Thread Starter Justin007h

    (@justin007h)

    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.
    https://tinypic.com/view.php?pic=4lt2s7&s=9#.XEzKbs17mrw

    @addweb-solution-pvt-ltd
    @laceyrod

    Job a11n

    (@jobthomas)

    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)
  • The topic ‘How to create a custom sidebar?’ is closed to new replies.