The MU forums have moved to WordPress.org

How to get current blog info in theme (4 posts)

  1. helmi
    Member
    Posted 15 years ago #

    Hi,

    how can i get information of the currently active blog within the theme? Is there some object like $post that contains current blogs name, id and stuff?

    Thanks,
    Frank

  2. andrea_r
    Moderator
    Posted 15 years ago #

    The normal stuff that grabs the blog's info from the theme is exactly the same. Only thing not there is the ID.

  3. helmi
    Member
    Posted 15 years ago #

    Thanks for jumping in andrea but i guess you got me wrong. I'll retry with some explanation. I have a private WPMU installation. I use the same theme for all blogs and like to bring in some switches based on the blog. So something like if($blog_id == 1) { do something; } elseif ($blog_id == 24) { do something else; } else { go home; } ;-)

    Got me? Is this possible any "official" way or do i have to work around with some custom function?

  4. andrea_r
    Moderator
    Posted 15 years ago #

    Ah, gotcha. :D

    (hand more tea over will ya?)

    "like if($blog_id == 1) { do something; } elseif ($blog_id == 24) { do something else; } else { go home; }"

    That's pretty much it.

    what kind of switches? Something outside of theme customization via options pages? I think I need an example.

About this Topic