• Hi

    I’m trying to set up a bbPress forum on my WordPress+Hueman blog.
    Here’s the result I currently have : http://www.geekdad.fr/forum/forum-parent-galactique/

    What I’d like to do is disable the sidebars. I tried several solutions but didn’t succeed.

    I tried the plugin “Widget Logic”, which allowed me to hide all plugins when on a forum page, but the empty sidebars where still there.

    From what I read, I understood that I need to put a condition on the sidebars, so that they do not show when the page is not a forum’s page :
    !is_bbpress()

    But I don’t know how to go further and actually have this to work.

    On top of that, I would like to have a specific sidebar for the forum, that would show on every page of the forum (main page, topic page, etc.).
    I know how to create a sidebar with Hueman and how to populate it, but I need to be able to tell it to appear only on forum pages :
    is_bbpress()

    Any idea ?

Viewing 15 replies - 1 through 15 (of 15 total)
  • Hi drchewbacca. I don’t believe the theme includes native support for bbpress. If you haven’t already searched the forum you might take a look at these posts and see if any of them help.

    bbpress isn’t perfect in Hueman, but as for the sidebars, I recommend the plugin Content Aware Sidebars. Very useful plugin for all things sidebar related. I was looking for the same as you, a separate sidebar only in forums, and Content Aware Sidebars fixed it.

    Thread Starter drchewbacca

    (@drchewbacca)

    Hi everyone

    Thanks for the replies.

    @bdbrown : you’re right, Hueman doesn’t have native support for bbpress, but my hope is that with a few tweaks, I can get it to work and look not too bad. I already found how to improve readability and adapt the colors to match those of my theme.
    The sidebars is, I think, the only big issue I have left.

    @nchrtd : thank you for the plugin. I did a quick test and didn’t not manage to get the result I wanted, but I may need to dig deeper. If I understand well, the plugin can let me define some conditions for a given sidebar to appear. What I need is also being able to define some conditions for the default Hueman sidebars to disappear ; it may imply recreating Hueman sidebars inside the plugin.
    I’ll come back here to let you know about the results.

    Thread Starter drchewbacca

    (@drchewbacca)

    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 :
    http://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 !

    I admit I don’t know anything about bbpress so am just throwing this out off the top of my head. After you register the bbPress sidebar it should be available like any other sidebar in the theme. Then, on the bbPress page, in Page Options, you should be able to select the single sidebar Layout, and select the bbPress sidebar as the Primary Sidebar. Seems like this should work without having to modify sidebar.php. I’m thinking the bbPress code example assumes the theme doesn’t have the option of selecting page layouts or sidebars on specific pages.

    Thread Starter drchewbacca

    (@drchewbacca)

    The problem is that bbPress is not embedded on a regular WordPress page.
    There are shortcodes that you can use to embed a forum in a post or in a page (this way you can remove the sidebars, using Hueman standard layout options), but in reality it’s just the “homepage” of the forum that is embedded. When you click on any of the forum’s link, to read a topic or see a user’s page, the template is going back to default.

    You can see an example here : http://www.geekdad.fr/test-forum/
    This is a page in which I have used a shortcode to call a forum’s main page. I disabled sidebars on this page, everything seems good. But if you click on a topic you will see that it’s going back to a standard sidebar layout.

    I’ve got more or less the same problem using Woocommerce. As is it a small site (not online yet), I decided to have no sidebars as default, which means that I have to set sidebars for every page or post.

    It works, but I really would like another/better solution, so I’ll follow this conversation with great interest.

    So it looks like the topic pages are picking up the default site layout of content left, 2 sidebars right (?). See if this css fixes it:

    .topic.bbpress .main-inner,
    .bbp-user-page .main-inner {
      background: none !important;
      padding-right: 0 !important;
    }

    The !important rule is used to keep the styles in effect when responsive.css comes into play on mobile views.

    Thread Starter drchewbacca

    (@drchewbacca)

    Almost there !
    Thanks a lot, you rock !
    It worked for the topic pages and user pages.
    Examples :
    http://www.geekdad.fr/topic/deuxieme-message/
    http://www.geekdad.fr/users/geekdad/

    But not for a forum main page :
    http://www.geekdad.fr/forum/forum-parent-galactique/
    or the main bbpress page (which lists all the available forums) :
    http://www.geekdad.fr/forum/

    I guess it’s just a matter of a few additions to the CSS that you gave me. I’ll try to find what I have to add – unless someone gives me the answer before I find it !

    Thread Starter drchewbacca

    (@drchewbacca)

    Ok, got it !

    Here’s the code !

    .topic.bbpress .main-inner,
    .forum-archive .main-inner,
    .forum .main-inner,
    .bbp-user-page .main-inner {
    	background: none !important;
    	padding-right: 0 !important;
    }

    I see you added the css to your custom css but, when I looked at the first two pages you linked and the forum main page you linked, it doesn’t look like the css is being applied as the sidebar background is still visible. WHen I add the css to your child theme style.css then it is applied. On the main bbpress page I didn’t see any sidebars that needed to be removed.

    Thread Starter drchewbacca

    (@drchewbacca)

    Hmmm… I guess it depends when you looked at the pages. I did some tweaks (and mistakes) during the last 30 minutes. Now everything seems ok. I added this CSS to my custom CSS :

    .topic.bbpress .main-inner,
    .forum-archive .main-inner,
    .forum .main-inner,
    .bbp-user-page .main-inner {
    	background: none !important;
    	padding-right: 0 !important;
    }

    And (for me) all 4 links display a page without any sidebar :
    topic : http://www.geekdad.fr/topic/deuxieme-message/
    user : http://www.geekdad.fr/users/geekdad/
    forum : http://www.geekdad.fr/forum/forum-parent-galactique/
    main : http://www.geekdad.fr/forum/

    Nope, I’m still seeing the sidebar backgrounds. Do you have a cache that needs to be updated? What happens if you move the code to your child theme style.css file?

    Thread Starter drchewbacca

    (@drchewbacca)

    I have some cache issues that I don’t understand (need to investigate that too…), some readers tell me they see my homepage from a few days ago, that the comment feed is not up to date when they come to the site, etc.
    Maybe that’s the reason ?

    I’ll try on several computers to see if I get the sidebars or not.
    I’ll come back here if it doesn’t seem to be ok. Until then I guess we can consider the issue as resolved.

    I have some cache issues that I don’t understand (need to investigate that too…), some readers tell me they see my homepage from a few days ago, that the comment feed is not up to date when they come to the site, etc.
    Maybe that’s the reason ?

    That’s the first thing I’d look at.

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘How to hide Hueman sidebars on bbPress forum ?’ is closed to new replies.