Opened 15 years ago
Closed 14 years ago
#1972 closed defect (bug) (fixed)
Bug: Wrong blog title
Reported by: | _DorsVenabili | Owned by: | apeatling |
---|---|---|---|
Milestone: | 1.5 | Priority: | normal |
Severity: | Version: | 1.2.6 | |
Component: | Core | Keywords: | blog, has-patch, needs-testing |
Cc: |
Description
I have installed the last trunk version of BP with WPMU 2.9.1.1.
When I create a new blog and I go to 'Custom Header' in 'Appearance' in that new blog, if I select 'Show text' and I save changes, it doesn't show the new blog's title, intead that it shows the default blog's title.
I have tried this creating in more than one blog and every time happens the same, cause every blog must to show their own title.
Attachments (1)
Change History (17)
#4
@
15 years ago
I'm sorry Andy, but I have checked the problem and it's a buddypress's bug too, cause this happens beacuse there is an error in a function in:
wp-content/plugins/buddypress/bp-themes/bp-default/header.php
We can see in line 44:
<h1 id="logo"><a href="<?php echo site_url() ?>" title="<?php _e( 'Home', 'buddypress' ) ?>"><?php bp_site_name() ?></a></h1>
But that is wrong, cause the function bp_site_name() only shows the deafault blog's name.
#5
@
15 years ago
- Resolution set to fixed
- Status changed from reopened to closed
I've fixed it. In file: wp-content/plugins/buddypress/bp-themes/bp-default/header.php in line 44:
<?php global blog_id; ?>
<h1 id="logo"><a href="<?php echo site_url() ?>" title="<?php _e( 'Home', 'buddypress' ) ?>"><?php echo blog_name($blog_id); ?></a></h1>
And we add the next function in functions.php
function blog_name($blogid){
global $wpdb;
$blogname = $wpdb->get_var("SELECT meta_value FROM wp_bp_user_blogs_blogmeta WHERE blog_id='".$blogid."' AND meta_key='name'");
return $blogname;
}
#8
@
15 years ago
I think it could have something to do with this ticket: When I change the name of a blog in the backend it doesn't get changed in BP (buddybar, directories etc) It still shows the old name.
#9
@
15 years ago
- Component set to Activity
Well, it's still quite broken for me in BP 1.2.2.1
This simple patch seems to fix it:
--- header-old.php 2010-02-21 02:02:40.000000000 +0000 +++ header.php 2010-02-21 01:54:31.000000000 +0000 @@ -41,7 +41,7 @@ <div id="header"> - <h1 id="logo"><a href="<?php echo site_url() ?>" title="<?php _e( 'Home', 'buddypress' ) ?>"><?php bp_site_name() ?></a></h1> + <h1 id="logo"><a href="<?php echo site_url() ?>" title="<?php _e( 'Home', 'buddypress' ) ?>"><?php bloginfo('name') ?></a></h1> <ul id="nav"> <li<?php if ( bp_is_front_page() ) : ?> class="selected"<?php endif; ?>>
#10
@
15 years ago
- Component changed from Activity to Blogs
- Owner set to apeatling
- Status changed from reopened to assigned
Note that it also doesn't show the blog subtitle, even on the main blog (e.g. "just another XXX weblog"), and the background color seems to be locked to that of the BP default theme. See http://ryppl.techarcana.net for an example. This is using the "Bold Red" Darwin theme.
#11
@
15 years ago
I have fixed it in this way:
function bp_site_name() {
echo apply_filters( 'bp_site_name', get_blog_option( $GLOBALS->blog_id, 'blogname' ) );
}
it works for me.
This is my first contribute, so I don't dare to set as resolved.
#12
@
15 years ago
just a little comment. This function is rarely used, so if there is a more used alternative, I reckon it should be deleted.
Of course unless I misunderstood the bp_site_name meaning (maybe it is the name of the entire site and not of one specific blog, nevertheless looks pretty useless in the latest version of BP).
#14
@
14 years ago
- Keywords needs-testing added; new title header custom removed
This needs to be confirmed against WP 3.0 and BP 1.2.6
This is a bug with the WordPress custom header API by the sounds of it. Please log this on the WordPress trac.