BuddyBoss Home – Web Support Forums Themes BuddyBoss theme Register Widget Area

Viewing 2 posts - 1 through 2 (of 2 total)
  • Question

    #31440
    @style960

    I’m trying to register a new widget ‘Header Profile’ to insert the Buddyboss Profile widget into. I’ve added this to functions:

    // Register header profile Widget

    if (function_exists(‘register_sidebar’)) {
    register_sidebar(array(
    ‘name’ => ‘Header Profile’,
    ‘id’ => ‘header-profile’,
    ‘description’ => ‘Header Profile’,
    ‘before_widget’ => ‘<div id=”one” class=”two”>’,
    ‘after_widget’ => ‘</div>’,
    ‘before_title’ => ‘<h2>’,
    ‘after_title’ => ‘</h2>’
    ));
    }

    And this to header:

    <!– Show logged-in Profile Widget –>
    <?php get_sidebar( ‘Header Profile’ ); ?>

    Dropped the Buddyboss Profile widget into the new area in admin, but on the front-end I end up with Categories and Recent Comments as though they’re the widgets I selected?

    What have I got wrong?

    Thanks,
    Paul.

    Answers

    #31471

    Alyssa
    Participant
    @alyssa-buddyboss

    @style960 you should read the WP codex here: http://codex.wordpress.org/Function_Reference/get_sidebar

    Specifically the order of which files are called.

    TL;DR by default sidebar.php is called and uses the default sidebar. Create your own sidebar-header-profile.php file and copy the template from sidebar-bbpress.php and change the displayed sidebar.

Viewing 2 posts - 1 through 2 (of 2 total)
  • The question ‘Register Widget Area’ is closed to new replies.