Tagged: bbpress
Dear Support:
I know the general fix is to activate “Sidebar on Single Post Entries”, but if I do that, it turns on the sidebar for all other posts, which I don’t want.
Is there a way to activate ONLY the BBPress Forum sidebar?
Please advise.
Thank you,
Tim
Hey Timothy,
Thank you for the inquiry.
You might be able to use the avia_layout_filter and the available bbPress conditional tags to adjust the layout of the bbPress forum. Try this code in the functions.php file.
add_filter('avia_layout_filter', 'avia_change_post_layout', 10, 2);
function avia_change_post_layout($layout, $post_id) {
if( bbp_is_forum_archive() || bbp_is_single_forum() ) {
$layout['current'] = $layout['sidebar_right'];
$layout['current']['main'] = 'sidebar_right';
}
return $layout;
}
Please keep the sidebar disabled for the single post entries.
// https://codex.bbpress.org/bbpress-conditional-tags/
Best regards,
Ismael
Dear Ismael,
You wizard! It worked!! Thank you! And my apologies for the delayed reply. For some reason the notification of your reply went into my junk folder (it usually does not) and I just now found it.
Thank you again, Ismael. Much appreciated.
Best,
Tim