Well, I didn’t succeed using Content Aware Sidebars. I managed to have a sidebar display only on posts, but the conditions related to bbpress forums didn’t seem to work.
nchrtd, you say it worked for you : are you using Hueman too ? Can you give me a link to your site, and tell me what settings you used ?
I tried other widget conditions plugins, but they did not allow to put conditions on sidebars (only on widgets).
Now I’m trying to follow the “without plugin” way described here :
https://codex.bbpress.org/layout-and-functionality-examples-you-can-use/#26-creating-a-bbpress-specific-sidebar
The problem is that this solution has been written for a theme that has only one sidebar area, whereas Hueman has two of them.
I managed to empty my forum pages’ sidebars, but they’re still here (and I still haven’t try to populate them with the forum specific sidebar that I’ve created.
Here’s my current result :
https://www.geekdad.fr/forum/forum-parent-galactique/
And here’s the modified sidebar.php :
<?php
$sidebar = alx_sidebar_primary();
$layout = alx_layout_class();
if (( $layout != 'col-1c') && !is_bbpress()) :
?>
<div class="sidebar s1">
<a class="sidebar-toggle" title="<?php _e('Expand Sidebar','hueman'); ?>"><i class="fa icon-sidebar-toggle"></i></a>
<div class="sidebar-content">
<?php if ( ot_get_option('sidebar-top') != 'off' ): ?>
<div class="sidebar-top group">
<p><?php _e('Follow:','hueman'); ?></p>
<?php alx_social_links() ; ?>
</div>
<?php endif; ?>
<?php if ( ot_get_option( 'post-nav' ) == 's1') { get_template_part('inc/post-nav'); } ?>
<?php if( is_page_template('page-templates/child-menu.php') ): ?>
<ul class="child-menu group">
<?php wp_list_pages('title_li=&sort_column=menu_order&depth=3'); ?>
</ul>
<?php endif; ?>
<?php dynamic_sidebar($sidebar); ?>
</div><!--/.sidebar-content-->
</div><!--/.sidebar-->
<?php if (
( $layout == 'col-3cm' ) ||
( $layout == 'col-3cl' ) ||
( $layout == 'col-3cr' ) )
{ get_template_part('sidebar-2'); }
?>
<?php endif; ?>
What I did is just add && !is_bbpress()
at the beginning.
I don’t speak php, so it’s a bit difficult for me to find where I should put these pieces of code to get the result I want…
If anyone could help me further, either with a plugin (recommended settings for Content Aware Sidebars) or with php tweaks, it would be great.
Thanks !