I pasted this code under main wp-config.php and side is gone.
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);
My question is how do we remo Options like Topic Type and Topic Status ???
Thank you.
you can use ‘widget logic’ plugin to control what is shown in sidebars. for bbpress the logic is
is_bbpress()
to display and
!is_bbpress()
to hide
or if you want a forum specific sidebar use ‘bbpress WP’ tweaks plugin.
Profile images use the gravatar image see http://en.gravatar.com/ for details
The main bbPress conditional tag is is_bbpress
Try <?php if ( !is_bbpress ) : ?>
ok, I can see your problem
Not sure why the plugin isn’t picking this up – would be worth a post on the authors support site
http://veppa.com/blog/forums/
However lets also try a different approach.
Download “widget logic”
https://wordpress.org/plugins/widget-logic/
This plugin lets you specify conditions for when widget items are displayed.
You would then put all the widgets for both the blog page and the forum page in one sidebar
Against each of these you then specify whether you want it to appear on the forum page, on any page with a sidebar that is not the forum 9ie your blog), or on both forum and other sidebar pages.
you do this by putting the following code in the widget logoc box that you will see appears against each widget
For a forum sidebar you put : is_bbpress()
ie is this page a forum page
For any other sidebar you put : !is_bbpress()
ie is this page NOT a forum page
For any item to appear on both, simply leave the logic blank.
Give that a try and come back and let us know how it works
Yes totally.
You can create a full width page forum if you wish – if your theme has a full width page option then just create a full width page, put the index shortcode within it [bbp-forum-index]
.
But it may be better to have a separate sidebar, so that you can have login and latest posts – see http://www.gospbc.co.uk/forums for an example.
Once you have installed bbpress, then install a plugin called bbPress WP tweaks. it gives you a forum specific sidebar, so you can add login and latest posts widgets
You can also use a plugin called “widget logic” with your normal sidebar to control what widgets are seen on what pages. For instance a widget will not appear if you use the logic !is_bbpress()
m or will appear if you use is_bbpress()
Well, 10 minutes after..I see there’s not much around. Went to the code and did a little tweak. I’m sharing this in case anybody need it:
add_filter( 'is_bbpress', 'my_bbpress_page' );
function my_bbpress_page( $retval = false ){
if ( is_page_template( 'my-template.php' ) ) {
$retval = true;
}
return $retval;
}
I’ll try and see if I have some time to make some docs around this. Having documentation is the key to have more things around this plugin.
Best,
Juan.
Hello,
I’m using this function in order to enqueue some custom CSS when a forum related page is loaded.
The problem is for example, the “New Topic” page – Part of bbPress – gives FALSE when I call is_bbpress()
Is there any place where I can check about this function besides going through the core code? I’ve searched over the Documentation and couldn’t find anything.
Thanks,
Juan.
I found out that I misunderstood your post. I downloaded plugin that you suggested and checked the code. I remembered that I used is_bbpress() somewhere and that was the solution for my problem. There’s the snippet of code that I used in my theme in file functions.php:
/* Do not search pages, only posts and if there's a request from bbPress or Admin panel than ignore setting of post type */
function search_filter($query) {
if ($query->is_search && !is_admin() && !is_bbpress()) {
$query->set('post_type', 'post');
}
return $query;
}
add_filter('pre_get_posts', 'search_filter');
Thank you very much again! 🙂 🙂
you can add this function to your functions.php
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);
or this to your style.css
.bbPress #primary {
display: none;
}
Still didn’t work for me, and I’ve had trouble with bbpress on other sites, so I’ve ditched it and gone with:
https://wordpress.org/plugins/forum-server/
Can’t see anything wrong with your code is_bbpress()
works on my conditional statements
I have some code to show the sidebar based on what page it is, and it works fine for the pages, but no sidebar shows on any bbpress pages:
if (is_page(79) || is_child(79) || is_ancestor(79) || is_bbpress()){
dynamic_sidebar(‘memberbar-sidebar’);
}
content.php seems like a weird place to be swapping an image, is this a header image or something?
From the way you’ve worded it I think maybe you need an if else statement around the specific image?
if( is_bbpress() ) {
// bbpress image
} else {
// default image
}
Is that the issue? If not, could you describe a bit more what you’re expecting to happen and what is happening instead please? It could also be that you actually need a BuddyPress if call rather than bb.
Hello,
I am using WordPress with bbPress(2.4) an buddyPress(1.8.1).
Trying to change the image when I am in the forum.
Trying it with : <?php if ( is_bbPress() ) : ?>
in my content.php under my theme…
No effect !
Are there other ways to change the appearance?
Greetings,
Tobias
is_bbpress()
is what your looking for.
Hey,
I found the same issue. In my case I patched bbPress to bail if the page isn’t a bbpress page. so in bbpress/includes/common/template.php line 2504 (include bbp_title() function, bbpress 2.4):
if (!is_bbpress()) {
return $title;
}
This must be a bug. Where can I submit a patch for this, or check if it’s a known bug?
Thanks,
Matt
Hi everyone
Is there a way of disabling bbpress jquery and css files loading when a user visits the blog?
upon installing bbpress the “weight/loading” of a blog page increases a bit, anyway of disabling it? Only loading when someone visits the forum?
The following code disables the bbpress css, is there a way to disable the javascript/jquery?
Thanks
function mp_deregister_bbstyles() {
if ( function_exists( 'is_bbpress' ) ) {
if ( !is_bbpress() ) {
wp_deregister_style( 'bbp-default-bbpress' );
}
}
}
add_action( 'wp_print_styles', 'mp_deregister_bbstyles', 100 );
Use the “Widget Logic” PlugIn and put !is_bbpress() into the respective field of your widget(s).
You have to do it for all widgets though …
Best regards
In bbPress’s default configuration, this is by design to support styling for widgets, which can exist outside of bbPress’s standard page views. You’ll need to write a custom plugin to dequeue bbPress’s CSS when ! is_bbpress()
.
I’d try contacting the developer, Yoast, and see if the can add a setting to disable the WP SEO plugins if bbPress is detected (is_bbpress()
), which would allow you bbPress to use its own breadcrumbs on bbPress pages and use WPSEO breadcrumbs on all other areas of the site.
Alternative he could also make his plugin disable the bbPress breadcrumbs all together.
As is_bbpress() doesn’t work within the bbp_theme_compat_actions hook, the solution would be to conditionnaly remove bbp_head and bbp_enqueue_scripts. It’s a bit more extreme but it works:
`add_action( ‘wp_head’, ‘conditional_bbpress_head’, 9 );
function conditional_bbpress_head(){
if( !is_bbpress() )
remove_action( ‘wp_head’, ‘bbp_head’ );
}
add_action( ‘wp_enqueue_scripts’, ‘conditional_bbpress_scripts’, 9 );
function conditional_bbpress_scripts(){
if( !is_bbpress() )
remove_action( ‘wp_enqueue_scripts’, ‘bbp_enqueue_scripts’ );
}`
I used “Bbpress wp-tweaks” it creates a bbpress sidebar that is used on the forum pages.
You could also use “Widget logic” – allows conditional statements on widgets to produce page or category specific sidebar content. Using the logic “is_bbpress()” allows sidebar specific content. “!is_bbpress()” excludes widgets from forum pages.
Try using `is_bbpress()` as the conditional.
The answer to my question about which template is being rendered (at least in my case) was `page.php`.
That’s `page.php` from your theme.
So if you, like me, want to do things to the main template in which the bbpress forums are housed, you can use `page.php`.
If you, like me, want to do things to that template ONLY for bbpress stuff, but not for other “pages” in your site, you can use the php function `is_bbpress()` in that template to render conditional html based on whether it is a bbpress page or not.
This seems like amazingly basic and obvious information that I was only able to discern by gritting my teeth and putting bbpress into the text editor and reading through A LOT of code. If this information is documented somewhere easy to find, please enlighten me so that i can perform the requisite face palm. If it’s not, why not?
This is untested by me, but digging through some more code, it looks like you might be able to create a custom home-base template for your bbpress forum by copying the original `page.php` into a new file and naming it any of:”
`’plugin-bbpress.php’,
‘bbpress.php’,
‘forums.php’,
‘forum.php’,
‘generic.php’`
You’re correct, `is_bbpress()` should be what you’re looking for.