Black Friday Sale! Get up to $40 off GP Premium!Learn more

[Resolved] Setting sidebar for BuddyPress/bbPress/Woocommerce

Home Forums Support Setting sidebar for BuddyPress/bbPress/Woocommerce

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #174570
    Oleg

    Some premium themes you can customize the layout of the left/right/not sidebaer, not only for the blog/page, but also for WooCommerce, BuddyPress, bbPress. Can I do this with GeneratePress?

    #174581
    Tom
    Lead Developer
    Lead Developer

    Yes, you can use this filter: https://generatepress.com/knowledgebase/choosing-sidebar-layouts/#sidebar-filter

    For example:

    WooCommerce

    add_filter( 'generate_sidebar_layout','generate_custom_woocommerce_sidebar_layout' );
    function generate_custom_woocommerce_sidebar_layout( $layout )
    {
     	// If we are on a woocommerce page, set the sidebar
     	if ( is_woocommerce() )
     	 	return 'both-left';
    
     	// Or else, set the regular layout
     	return $layout;
    
     }

    BuddyPress

    add_filter( 'generate_sidebar_layout','generate_custom_buddypress_sidebar_layout' );
    function generate_custom_buddypress_sidebar_layout( $layout )
    {
     	// If we are on a buddypress page, set the sidebar
     	if ( is_buddypress() )
     	 	return 'both-left';
    
     	// Or else, set the regular layout
     	return $layout;
    
     }

    bbPress:

    add_filter( 'generate_sidebar_layout','generate_custom_bbpress_sidebar_layout' );
    function generate_custom_bbpress_sidebar_layout( $layout )
    {
     	// If we are on a bbpress page, set the sidebar
     	if ( is_bbpress() )
     	 	return 'both-left';
    
     	// Or else, set the regular layout
     	return $layout;
    
     }
    #174602
    Oleg

    Thank you! I can not help wondering how your theme is flexible and convenient. It is much more complicated than it seems at first glance.

    #174614
    Tom
    Lead Developer
    Lead Developer

    It would be nice to have all these options in the customizer but things would get very messy/overwhelming.

    Having these filters and hooks everywhere at least makes it so basically anything is possible 🙂

    #174617
    Oleg

    I think your theme somewhere between Genesis and Avada 🙂

    #174714
    Tom
    Lead Developer
    Lead Developer
Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.