Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: Rename sitewide page headers so “Blog” doesn't appear


Brajesh Singh
Participant

@sbrajesh

hi David

As I mentioned above, it is nothing but a hack of the bp_get_page_title, here is adaption you can use

add_filter("bp_page_title", "bpdev_blog_title",10,2);

function bpdev_blog_title($complete_title,$title_old){
global $bp,$current_blog,$wp_query,$post;
if ( bp_is_blog_page() ) {//if this is blog page
if ( is_single() ) {
$title = __($post->post_title, 'buddypress' );
} else if ( is_category() ) {
$title = __( 'Categories | ' . ucwords( $wp_query->query_vars['category_name'] ), 'buddypress' );
} else if ( is_tag() ) {
$title = __( 'Tags | ' . ucwords( $wp_query->query_vars['tag'] ), 'buddypress' );
} else if ( is_page() ){
$title = $post->post_title;
}
if ( defined( 'BP_ENABLE_MULTIBLOG' ) ) {
$blog_title = get_blog_option( $current_blog->blog_id, 'blogname' );
} else {
$blog_title = get_blog_option( BP_ROOT_BLOG, 'blogname' );
}
if(!empty($title))
return $blog_title . ' | ' . esc_attr( $title );
}
//so on blog home page, It will show Blog,reason we have excluded that page
return $complete_title;
}

Hope, It should help you, you can modify the various titles as you wish for the category/tags etc.

Skip to toolbar