This topic has 3 replies, 2 voices, and was last updated 9 years by Laura.

  • Author
  • #133562
     wingnut
    Participant

    Hello again,

    What is the correct way to have a different sidebar specifically for BBPress and/or BuddyPress sections? Selecting the sidebar at the bottom doesn’t work if there is no Edit for that element.

    Here is the code I am trying in my child theme Functions.php, but it is not working — though I have these sidebars defined in Appearance>Sidebars:

    // Custom BP Sidebars
    // get the global sidebar
    if (!function_exists(‘kleo_sidebar’)):
    function kleo_sidebar()
    {
    if ( is_bbpress() ) {
    get_sidebar(‘forums-sidebar’);
    }
    else if ( is_buddypress() ) {
    get_sidebar(‘community’);
    }
    else get_sidebar();
    }
    endif;

    Currently everything is just returning the main sidebar.

    Thank you!
    Josh

    #133650
     Laura
    Moderator
    Not marked as solution
    #133743
     wingnut
    Participant
    Not marked as solution
    #134118
     Laura
    Moderator
    Not marked as solution
Viewing 4 posts - 1 through 4 (of 4 total)

The forum ‘General questions’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?