Support » Networking WordPress » Sharing css files across all blogs in multisite

  • popstalin

    (@popstalin)


    I know this isn’t the true purpose of MS but we’re using MS to create separate sections of our site so most of the site(S) uses similar themes and CSS. I’m wondering if there is a way to share specific CSS files across all sites other than linking with the full URL. For example, our IE specific stylesheets will have the same function on all our sites, instead of updating multiple IE css files for each theme, is it possible to park them someplace and then link from there using something like:

    <link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo('template_directory'); ?>/ie8.css" />

    Or should I use the full URL in the header file of each theme? Right now we have about 12 sites and going through and updating all of those with the IE specific CSS is a pain.

    I’d love to be able to do this with my footer and header files as well (if possible and easy).

    TIA!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    Is the ie8.css in the theme’s folder?

    If so, <link rel="stylesheet" type="text/css" media="all" href="<?php echo get_template_directory_uri(); ?>/ie8.css" />

    That will be relative per site 🙂

    See http://codex.wordpress.org/Function_Reference/get_template_directory_uri

    Thread Starter popstalin

    (@popstalin)

    Yes, I know it’s relative to that site. I was wondering if there was a way similar to the code I provided. Obviously, I didn’t make that clear. For now I’ve created a theme folder called css-ie and placed my IE css files in there and linked absolutely to those files.

    I was hoping for a “cleaner” way to do that. 🙂

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Sharing css files across all blogs in multisite’ is closed to new replies.