Skip to:
Content
Pages
Categories
Search
Top
Bottom

[Resolved] Remove the extended profile title tag


  • omgbud
    Participant

    @omgbud

    Hello guys,

    please help me with this.

    How can I remove the extended profile title tag? Currently when I visit a member’s profile page the title show on browser tab is “blog name member’s name | extended profile”, I want to remove the “| extended profile”.

    thank you so much.

Viewing 2 replies - 1 through 2 (of 2 total)

  • dio1987
    Participant

    @dio1987

    I have the same question. Even when we share a profile on Fb we see the title “extended profile”. How can we change that?


    danbp
    Moderator

    @danbp

    hi @dio1987,

    give this a try. Component name will be removed only when you’re on a profile

    
    function my_profiles_wp_title( $title ='', $sep = '', $seplocation = '' ) {
    	if( bp_get_displayed_user_fullname() ) {
    		$bp = buddypress();
    		
    		// Get the component's ID to try and get it's name
    		$component_id = $component_name = bp_current_component();
    		
    		// Use the actual component name
    		if ( !empty( $bp->{$component_id}->name ) ) {
    			$component_name = $bp->{$component_id}->name;
    			
    			// Fall back on the component ID (probably same as current_component)
    		} elseif ( !empty( $bp->{$component_id}->id ) ) {
    			$component_name = $bp->{$component_id}->id;
    		}
    		
    		$title = str_replace( ucwords( $component_name ), '', $title );
    	}  
    	return $title;
    }
    add_filter( 'bp_modify_page_title', 'my_profiles_wp_title', 20, 3 );
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Resolved] Remove the extended profile title tag’ is closed to new replies.
Skip to toolbar