BuddyDev

Search

[Resolved] Suppressing sidebar when displaying a single BP post

  • Participant
    Level: Enlightened
    Posts: 76
    Janet B on #35639

    Hello,

    There are a variety of helpful layout settings for the CB theme. However, I am unable to find a way to make the sidebar go away when displaying a single BP activity item.

    Is there a setting in the Theme setup that I might have missed?

    Janet

  • Keymaster
    (BuddyDev Team)
    Posts: 24271
    Brajesh Singh on #35657

    Hi Janet,
    Thank you for the question. We haven’t provided it as an option(we did not consider providing it for individual profile components).

    It can be still achieved easily with a few lines of code. Will you be able to use it?

    Regards
    Brajesh

  • Participant
    Level: Enlightened
    Posts: 76
    Janet B on #35665

    Thanks Brajesh,

    What did you have in mind?

    Janet

  • Keymaster
    (BuddyDev Team)
    Posts: 24271
    Brajesh Singh on #35685

    Hi Janet,
    Please put this code in your child theme’s functions.php

    
    
    /**
     * Make community Builder single activity pages as single column.
     */
    add_filter( 'cb_page_layout', function ( $layout ) {
    	if ( bp_is_single_activity() ) {
    		$layout = 'page-single-col';
    	}
    
    	return $layout;
    } );
    

    That will do it.

    Regards
    Brajesh

  • Participant
    Level: Enlightened
    Posts: 76
    Janet B on #35699

    Worked great! Thanks 🙂

    Janet

  • Keymaster
    (BuddyDev Team)
    Posts: 24271
    Brajesh Singh on #35700

    Hi Janet,
    Thank you for confirming.

    Regards
    Brajesh

The topic ‘ [Resolved] Suppressing sidebar when displaying a single BP post’ is closed to new replies.

This topic is: resolved