Youngwook Kim
asked 7 years ago

Hello,
is there any way to have only bbpress’s sidebar?
 
Thanks

1 Answers
DominicStaff
answered 7 years ago

Hello Youngwook !
To add the sidebar bbpress as your request, please do as the following:
Step1: You can log in to Dashboard >> Pages >> Add New/ Edit Page, open up the Page you want  to add the sidebar, and add the following shortcode to the content editor of the page:

[bbp-forum-index]

In the Page Attributes pane on the right hand side, select the template as Full Width.
Please find the shortcode of bbpress here:  http://codex.bbpress.org/shortcodes/ Step2: Log in to Dashboard > Appearance > Customize > General setting, Add the following code to the Header script:

<style>
.bbpress .span9 {width: 1040px;}
.bbpress .entry-content {float: none !important;max-width: 100% !important;}
.bbpress .row {background:none !important;}
</style>

Step3: Add the following code to the functions.php file.

function disable_all_widgets( $sidebars_widgets ) {       
    if ( function_exists('is_bbpress') ) {
        if (is_bbpress()) {
            $sidebars_widgets = array(false);
            remove_all_actions('bp_register_widgets');
            unregister_sidebar( 'bp_core_widgets' );
        }
    }
    return $sidebars_widgets;
}

add_filter('sidebars_widgets', 'disable_all_widgets', 1, 1);

Hope this helps !

Powered by DW Question & Answer Pro