The MU forums have moved to WordPress.org

Getting the current blog name (2 posts)

  1. hempsworth
    Member
    Posted 16 years ago #

    How do I get the current blog name without printing/echoing it?

    I'm working on a website for my school, and I'm trying to determine whether the current blog is for a department or not. Each department blog has a name with "X Department" so I'm going to do the following:

    if (preg_match("/Department/", bloginfo('name'))) {
    $section = "department";
    };

    But "bloginfo('name')" is printing the result onto the page, so I just end up with "Art Department" being outputted.

    So... How do I get the current blog name without printing/echoing it?

    Thanks!

  2. MrBrian
    Member
    Posted 16 years ago #

    Use get_bloginfo('name')

About this Topic

  • Started 16 years ago by hempsworth
  • Latest reply from MrBrian