Hello Pasifik,
Thank you for the posting. It is not clearing me your requirement. Please do let me know are you asking to rename the group title in the group’s directory page as mentioned above or anything else.
Please do let me know are you using BuddyPress Or BuddyBoss Platform?.
Regards
RaviHello,
The platform I use is BuddyPress. I want to remove the “Ana Sayfa” (ing: Home Page) parts that appear in the search query below.
Hello,
Thank you for sharing the details. Please try the following code in your bp-custom.php file
add_filter( 'bp_get_title_parts', function ( $bp_title_parts ) { if ( bp_is_group() ) { $bp_title_parts = buddypress()->bp_options_title; } return $bp_title_parts; } );
Please do let me know if it works or not.
PS: https://buddydev.com/docs/buddypress-guides/what-is-bp-custom-php/
Regards
RaviThis worked. The code is working. But there is another problem. The titles of the subpages were also the same. This is bad for SEO. Can we do that?
For the group home page.
(Group name – Site name) or (Group name – Home Page – Site name)
For group subpages.
Current status ===>>> Must be such.
İnfo – Group name – Site name | * Group name – İnfo – Site name
Media – Group name – Site name | * Group name – Media – Site name
Members – Group name – Site name | * Group name – Members – Site nameHello,
Please check the following code and let me know if it works or not:
add_filter( 'bp_get_title_parts', function ( $bp_title_parts ) { $bp = buddypress(); if ( bp_is_group() ) { $component_id = bp_current_component(); if ( ! empty( $bp->{$component_id}->nav ) ) { $secondary_nav_item = $bp->{$component_id}->nav->get_secondary( array( 'parent_slug' => bp_current_item(), 'slug' => bp_current_action(), ), false ); if ( $secondary_nav_item ) { $secondary_nav_item = reset( $secondary_nav_item ); } } $single_item_subnav = ''; if ( ! empty( $secondary_nav_item->name ) ) { $single_item_subnav = $secondary_nav_item->name; } $bp_title_parts = array( $bp->bp_options_title, $single_item_subnav ); $bp_title_parts = array_map( '_bp_strip_spans_from_title', $bp_title_parts ); } return $bp_title_parts; } );
Regards
Ravi
The topic ‘ [Resolved] Buddypress group title’ is closed to new replies.