same sidebar for each forum topic/forum
-
How can I set the same sidebar for each forum/topic? I could easly set that up for the index of the forum, registration part and forget password section, because thats a page in WP. But when I want the same sidebar for an other subforum, I can’t choose a template, because it isn’t a page. How can I manage this?
-
Hi,
Start from this article: https://codex.bbpress.org/layout-and-functionality-examples-you-can-use/#26-creating-a-bbpress-specific-sidebar
Come back if you need anything else.
Pascal.I followed the steps, but the right sidebar doesn’t show up, the main-sidebar is still vissible.
My code in the functions.php:
function rkk_widgets_init(){ register_sidebar(array( 'id' => 'bbp-sidebar', 'name' => __( 'Forum sidebar', 'rkk' ), 'description' => __( 'Sidebar voor het forum', 'rkk' ), 'before_widget' => '<div id="%1$s" class="forum-widget %2$s">', 'after_widget' => '</div>', 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>' )); } add_action('widgets_init', 'rkk_widgets_init');
The code in the sidebar.php:
<?php if (is_active_sidebar('main-sidebar') && !is_bbpress()) : ?> <div id="secondary" class="widget-area" role="complementary"> <?php dynamic_sidebar('main-sidebar'); ?> </div><!-- .widget-area --> <?php elseif (is_active_sidebar('bbp-sidebar') && is_bbpress()) : ?> <div id="secondary" class="widget-area" role="complementary"> <?php dynamic_sidebar('bbp-sidebar'); ?> </div><!-- .widget-area --> <?php endif; ?>
In the backend, the forum widget does appear, and I can add Widgets to it. Only on the front-end, on forum pages, he doesn’t show the right sidebar.
I have to correct something. De right sidebar only doens’t show on the root(index?) of the forum. The other forums/topics he does show the right one 🙂
How is this possible?
It’s because you use the standard page that is generated on /forums
Try to create a new page in WordPress, make sure the slug is /forums (give it any title you want) and then as only text put [bbp-forum-index]
Pascal.
I already have a page created in WP with the [bbp-forum-index] code in it. So, I don’t understand it.
I created a template to resolve the problem, like at first. Otherwise I wouldn’t know.
I’ve got the same or similar issue using Jupiter theme. Site is set to full layout (thus no sidebar)
Forums do start on a Page, but otherwise exist in Posts which i dont see how to assign widgets/sidebars/template etc in order to facilitate navigation. So when clicking into the forum navigation, any sidebar items assigned to the forum root page, aren’t brought in. User has to user browser Back button to get back to root forum. I’m failing to get it to look and feel like forums are expected. i chose bbpress to have single sign on, but would welcome other options at this point or a direction in how to get different layout, sidebar navigation and such to show for bbpress forum posts. thanks in advance.
- You must be logged in to reply to this topic.