multisite with dynamic footer.php; same theme (8 posts)

  1. bdoreste
    Posted 5 years ago #

    I have few blogs running on a single multisite install, and want to use the same theme for all of them.

    The catch: I want to vary the footer.php depending on what blog is being accessed.

    i.e., if blog123 is accessed, one set of footer info/links is displayed, if blog 234 is accessed, another set is displayed, etc...

    I assume the syntax would be similar to the conditional tags needed for the meta robots in the header (like below)

    <?php if(is_single() || is_page() || is_home() || is_category()) { ?>
    <meta name="robots" content="index,follow,noodp" />
    <?php } else { ?>
    <meta name="robots" content="noindex,noarchive,follow,noodp" />
    <?php } ?>

    but am unsure how to single out a single blog id or domain.


  2. mcfd90
    Posted 5 years ago #

    You used to be able to edit the footer under Appearance > Footer for each individual blog, this seems to have been removed - at least by default. I'll let you know if I find a solution.

  3. mcfd90, that depends on the theme, I think.

    To the original question, I think you could use $current_site somehow.

    Or better, use get_current_site()


  4. mcfd90
    Posted 5 years ago #

    Thanks ipstenu.

    The Super Admin is still allowed to modify them for users otherwise I was going to make the footer a sidebar like in twentyten... I'll try that.

  5. I think I'd just widgetize the footer.

  6. mcfd90
    Posted 5 years ago #

    bdoreste I had been going to suggest using bloginfo('name'); but get_current_site() is much better (as names can be changed by the user).

    Many thanks Andrea_r and ipstenu. So I'm not thread hijacking I've moved here.

  7. bdoreste
    Posted 5 years ago #

    mcfd90, thanks for the response!

    I ended up using get_bloginfo('url') with a series of if statements, but will try implementing get_current_site() instead.

    thanks again!

  8. Get current site referrs to the *network* name, not the site. In the code sites are blogs, the network is a site.

    get_current_site() will always return your main domain, unless you have multiple networks.

Topic Closed

This topic has been closed to new replies.

About this Topic