Celebrating 7 Years! Get up to $30 off GeneratePress Premium!

[Resolved] wocommerce sidebar

Home Forums Support [Resolved] wocommerce sidebar

Home Forums Support wocommerce sidebar

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #549140
    sg

    Hi guys, i read many topics regarding this but some were outdated. hoping to get some latest update πŸ™‚

    Loving GP !

    the case is i need a custom sidebar for my woocommerce and all its related pages. i tried few sidebar and widget plugins but nothing works with woocomerce.

    so i assume now my only solution is to register a sidebar and add it as snippet .

    1. register sidebar , is this the code ? ps mysidebar name is Shop-Sidebar

    function arphabet_widgets_init() {
    
    	register_sidebar( array(
    		'name'          => 'Shop-Sidebar',
    		'id'            => 'shop-sidebar',
    		'before_widget' => '<div>',
    		'after_widget'  => '</div>',
    		'before_title'  => '<h4>',
    		'after_title'   => '</h4>',
    	) );
    
    }
    add_action( 'widgets_init', 'arphabet_widgets_init' );
    
    add_action('generate_woocommerce_sidebars','generate_contsruct_sidebars');
    function generate_contsruct_sidebars()
    {
    	get_sidebar('Shop-Sidebar'); 
    	
    }

    2. call in sidebar for wc

    add_action( 'wp','tu_woocommerce_sidebar' );
    function tu_woocommerce_sidebar()
    {
        if ( function_exists( 'is_woocommerce' ) && is_woocommerce() ) {
            remove_action( 'generate_sidebars','generate_construct_sidebars' );
            add_action( 'generate_sidebars','tu_construct_woocommerce_sidebar' );
        }
    }
    
    function tu_construct_woocommerce_sidebar() {
        get_sidebar( 'Shop-Sidebar' );
    }
    

    i know somewherer is wrong , pls correct me , thanks !

    GeneratePress 2.0.2
    GP Premium 1.6.2
    #549586
    Leo
    Staff
    Customer Support

    Hi there,

    Just making sure, you’ve tried this plugin and it doesn’t work?
    https://wordpress.org/plugins/content-aware-sidebars/

    Let me know πŸ™‚

    #549603
    sg

    i manage to solve it ,
    just need to search sidebar manager that support woocommmerce.
    codecanyon has few.

    thanks Leo for looking into this. cheers !

    #549608
    Leo
    Staff
    Customer Support

    Awesome πŸ™‚

    Glad you found the solution!

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