Skip to:
Content
Pages
Categories
Search
Top
Bottom

Added Widgets to Groups sidebar


  • neuromancer2701
    Participant

    @neuromancer2701

    What is the best way to added widgets to the Groups sidebar?

    Edit: bp-groups-widgets.php??

    Is there a way to add the groups sidebar to Appearance > Widgets?

    Thanks

Viewing 1 replies (of 1 total)
  • That is a core file. Don’t hack that. I’m going to assume you’re using the parent/chid theme that comes with BP 1.1.3. If so, copy the following file into your child theme (including the folders… i.e. /directories/groups/):

    /wp-content/themes/bp-sn-parent/directories/groups/index.php

    You can find the sidebar area there pretty easily:

    <div id="sidebar" class="directory-sidebar">

    Simply code what you want right inside that div. Or to make it use one of the existing three sidebar in the classic theme, add this code:

    <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('third-section') ) : ?>

    This would add the widgets from the “third-section” sidebar in Appearance > Widgets.

    You could also register a new sidebar if you wish, just for groups. Create a functions.php file in your child (if you’re using a child theme) and add this:

    register_sidebars( 1,
    array(
    'name' => 'groups-sidebar',
    'before_widget' => '<div id="%1$s" class="widget %2$s">',
    'after_widget' => '</div>',
    'before_title' => '<h2 class="widgettitle">',
    'after_title' => '</h2>'
    )
    );

    In that case… just change “third-sectoin” in the code above to “groups-sidebar”… or whatever you choose to name that widget area when you registered it using the “register_sidebars” function above.

Viewing 1 replies (of 1 total)
  • The topic ‘Added Widgets to Groups sidebar’ is closed to new replies.
Skip to toolbar