12

I have a wordpress multisite installtion with 5 sites within, the multisite is called Lifestyle

  1. Homes
  2. Cars
  3. Architecture
  4. Holidays
  5. Communities

I am trying to get the blog name, for each blog when viewing in my theme, every function I use returns 'Lifestyle'.

I have tried;

get_bloginfo('name');

get_bloginfo();

global $current_site; var_dump(get_current_site_name($current_site));

get_current_blog();

none of the strings or objects returned contain the blog name, they all contain the site name "Lifestyle" can anyone offer any advice...

1
  • social-ink.net/blog/… this looks interesting.... anything you can work with? Wait, I might be misunderstanding.... you are trying to list each site ON said site, or sites on the main site? Commented Apr 21, 2011 at 11:54

1 Answer 1

29

This is what you need:

global $blog_id;
$current_blog_details = get_blog_details( array( 'blog_id' => $blog_id ) );
echo $current_blog_details->blogname;

Have a nice multisite! :)

2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.