Bbpress and pro

I’ve set up a bbpress forum installed from your pro dashboard as a suggested plugin.

There are some issues with some elements with your templates. For example the breadcrumbs not showing up and could not be activated for example by bbpress style.

The reason is that you deactivate the breadcrums for some reasons in /pro/framework/legacy/functions/plugins/bbpress.php

Bildschirmfoto 2021-08-27 um 16.45.57

If i added this back manualy the breadcrumbs reapears!

add_filter( 'bbp_no_breadcrumb', '__return_false' , 999);

The bbpress search results fire up the layout with condition set to post-type is ‘posts’ and i don’t find a condition to set up a custom layout for forum search results!


I've tried to overwrite the templates in `/pro/framework/legacy/templates/bbpress` within the child-theme `/pro-child/framework/legacy/templates/bbpress` but this seems not to be working.

Hello @Regnalf,

Thanks for posting in!

We have removed the bbPress breadcrumbs on purpose from all default locations and later added them back in the breadcrumbs.php file to allow for standard output as the breadcrumbs are filtered below to be used there.

And yes, the default layout of the bbPress is set to use the single post layout. If you want something custom, you can go to Cornerstone > Layout Builder and create a single layout. You can then assign this layout that will display when the post type is bbPress “Forum” or bbPress “Topic”.

Screen Shot 2021-08-28 at 7.43.31 AM

Hope this helps. Kindly let us know how it goes.

Thanks @ruenel , that helped me to add additional style to the single pages for forum, topic and reply. But the forum search result is an archive! How can i catch this?

Hey @Regnalf,

Additionally, you can create an archive layout and assigned it to the Search Results and the Post type is Forum.

Screen Shot 2021-08-29 at 6.38.43 AM

Hope this helps.

Hi @ruenel, no that didn’t catch the forum search results. They seem not be usual search querys because the url string ist like domain.com/mitgliederbereich/foren/suche/all/ and not the usual domain.com/?=searchterm

As a wrote the post type post layout is firing:

Bildschirmfoto 2021-08-29 um 13.42.27

If created a forum search (“Forum Suche”) Layout if you wanna try it out

Hey @Regnalf,

Like the Forum Index, there is no option to override the Forum Search too like in this thread. This would currently need custom development.

I’ll add this as a feature request together with the support for Forum Index.

Thanks.

My solution, regarding the post you mentioned, is now not to use the shortcode with a custom page but the basic function of bbpress. The page is now generated normally by bbpress.

To be able to customize the page (especially if you want to change the body background) I currently use the following code:

add_filter( 'body_class', 'body_add_class_bbpress_index' );
function body_add_class_bbpress_index( $classes )
{
	global $wp;

	if ($wp->request == get_option ('_bbp_root_slug'))
	{
		$classes[] = "bbpress bbpress-index";
	}

	return $classes;
}

The pages for forum and theme can already be designed as discussed above.

But bad is the missing search output! This is not a feature request, this is a basic function! Especially if bbpress is listed as a compatible plugin!

Hey @Regnalf,

It sounds like you’re suggesting the case is a bug so I quickly tested that code and it works for bbPress Forum Index only even in the default WordPress theme. In Pro child theme, the search output is not missing on my end.

With that said, if you’re expecting it to work in the bbPress search result page or forum pages, that won’t work. The problem is that code and regretfully, we cannot provide further assistance with that as you already know, it’s beyond the scope of theme support.

Please consider subscribing to One if you wish to receive answers to custom development questions.

Lastly, compatibility doesn’t include custom codes. What’s included are the core functions of a plugin and in the case of bbPress, they work except for the ones that our development team has purposely removed.

Thank you for understanding.

Sometimes you just have to dig deeper! I took another look at the problem and it’s definitely the theme that’s causing this problem!

As mentioned above I also created an archive layout for normal posts. Post type => Posts (“Beiträge” means Posts)

And this archive layout will be executed when the search should come from bbpress.
If I disable this archive layout (i deleted the Post Type condition) the search results appear! There is no more custom code from my side that cause this issue!

Bildschirmfoto 2021-08-31 um 12.56.59

So why does the forum search catch the condition post type => posts? If you can’t answer that, it’s clearly missing functionality!

Thank you for understanding.

Hey @Regnalf,

I think there’s a misunderstanding here. I’m referring to the custom code to add body class.

Regarding the Archive Layout > Post Type = Post, there might be a commonality with the Post Post Type and the bbPress Search Result page.

The Condition that won’t interfere with the bbPress Search Result page is Post Taxonomy is Category OR Post Taxonomy is Tag. Don’t use Post Type is Post for the Archive Layout at least for now.

image

We can’t say this is a bug yet but I’m going to post this in our issue tracker so this will be queued for further investigation.

Hope that helps.

You are right, if you follow the thread we are really talking about two things.

Ok, regarding my customer code. It works fine, and I have refined it a bit. Here again for those who need it as well:

add_filter( 'body_class', 'body_add_class_bbpress' );
function body_add_class_bbpress( $classes )
{

	global $wp;

	$bbpress_index = get_option ('_bbp_root_slug');
	$bbpress_search = get_option ('_bbp_search_slug');
	
if (strpos($wp->request, $bbpress_index) !== false)
{
	$classes[] = "bbpress";		
}

if ($wp->request == $bbpress_index)
{
	$classes[] = "bbpress-index";
}

if (strpos($wp->request, $bbpress_index . "/" . $bbpress_search) !== false)
{
	$classes[] = "bbpress-search";		
}
	
	return $classes;
}

Regarding the search function, I tried the post category and keyword taxonomy, the forum search works but the archive page posts is not triggered with it.

What does work though is the "blog - is - currently being displayed" condition.
So now the forum search and the posts page works.

I’ll test this more closely to see if any other problems come up.

Thanks @christian for further investigation .

You’re welcome, @Regnalf

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.