0

I am looking to add custom text to the site in functions.php.

I am using multisite. Is there a hook to determine which site so I can alter the text?

For example:

function greeting(){
    if(site_name('one'){
    echo 'hello';
    } elseif(site_name('two')){
    echo 'goodbye';
    }
}
  • Where do you want to alter the text. Please be more specific. – kaiser Dec 19 '13 at 22:23
  • @kaiser Below the header in the main part of the index page – Shawn Dec 20 '13 at 2:14
1

You can use get_blog_details() to do it.

Use it the following way:--

function greeting() {
    global $blog_id;
    $current_blog = get_blog_details( $blog_id );

    if ( 'one' == $current_blog->blogname ) {
        echo 'hello';
    } elseif ( 'two' == $current_blog->blogname ) {
        echo 'goodbye';
    }
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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