Remove house icon and home link in bbpress breadcrumbs

I am using both bbpress and buddypress. In buddypress pages I can set the first breadcrumb to be my forum root and rename it.

However within the bbpress forum the breadcrumb is adding a home icon and a link to my website home page. I want to remove this first part.

This is the code currently in my functions.php file. What I don’t understand is that the first part of this code is saying ‘make the forums the root’.

// CHANGE 'FORUMS' TO 'FTBMATES' IN THE BREADCRUMB
// =============================================================================
function my_custom_breadcrumbs( $crumbs, $args ) {

foreach ( $crumbs as $i => $crumb ) {
 if ( $crumb['type'] === 'bbp-breadcrumb-root' && $crumb['label'] === 'Forums' ) {
  $crumbs[$i]['label'] = 'ftbmates';
}

	if (bp_is_my_profile()) {
	$crumbs[0]['label'] = 'FTBMates';
    $crumbs[0]['url'] = '/ftbmates';
	$crumbs[1]['label'] = 'My Home';
    $crumbs[1]['url'] = '/ftbmates/me/';
	$crumbs[2]['label'] = '';
    $crumbs[2]['url'] = '';


}

	if ( bp_is_user() ) {
		$crumbs[0]['label'] = 'FTBMates';
    $crumbs[0]['url'] = '/ftbmates';
	$crumbs[1]['label'] = 'My Home';
    $crumbs[1]['url'] = '/members/me/';

		
	}

}

return $crumbs;

}

add_filter( 'x_breadcrumbs_data', 'my_custom_breadcrumbs', 10, 2 );

function breadcrumbs_for_account ( $crumbs, $args ) {
	if (is_page('40350')) {
	$crumbs[0]['label'] = 'FTBMates';
    $crumbs[0]['url'] = '/ftbmates';


		}
	if (is_page('34779')) {
	$crumbs[0]['label'] = 'FTBMates';
    $crumbs[0]['url'] = '/ftbmates';


		}

	return $crumbs;
}
add_filter( 'x_breadcrumbs_data', 'breadcrumbs_for_account', 10, 2 );

Hello @demonboy,

Thanks for writing in!

Providing support for custom code or 3rd party plugins falls outside the scope of support we can offer. However, you can take a look at following resources for some inputs. Some of the threads are dated but the logic remains the same:

https://bbpress.org/forums/topic/how-do-i-remove-first-two-parts-of-breadcrumb/

Here’s the Google search result that you can take a look. Please click here.

Thanks for understanding.

This isn’t a plugin, this code is simply added to my X theme CSS file.

Hi @demonboy,

It’s custom code and we don’t maintain any custom code. And I myself aren’t sure about those conditions, I checked our theme and plugin coding and I don’t see any type of bbp-breadcrumb-root. I recommend contacting the author of that code and see if he can improve it :slight_smile:

Plus, that kind of customization only alters the labels and URL, but the icons may still be the same.

Thanks!

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