As the title says, I have a multi-site setup and the apperance is customized with child themes.

The main site: themainsite.com

Secondary site foo.com

When you look into the source code of foo.com, you see some URLs referencing to the mainsite. Such as:

<link rel="stylesheet" 
type="text/css" media="screen" />

I checked wordpress documentation for get_stylesheet_directory_uri, but could not find an answer. Is it possible to remove these kind of references to the main site?

UPDATE: All the CSS/JS references are handled in the header.php of the parent template like below. I already have a header.php oin my child theme which overrides the parent theme's header.php.

<link rel="stylesheet" 
href="<?php echo get_template_directory_uri()  ?>/css/some.css" 
type="text/css" media="screen" />

2 Answers 2


I fixed it with changing the multi-site setup from sub-folders to sub-domains.


Note: I'm going for an answer, because for a comment this is quite too much text. With your response, I will be trying to edit and elaborate, and provide you with an actual answer to your question.

Is it possible to remove these kind of references to the main site?

That depends on how (well) the themes are designed, where/why this some.css is enqueued/hard-coded, and how you want to remove the line.

Did you find where the stylesheet is handled? What is it used for? Do you want to adjust the parent theme, or the child theme only?

» The ungallant way

I would not prefer this, but assuming the stylesheet is hardcoded in the parent theme, which you don't want to adjust, you could delete the stylesheet (if it is really not needed, that is) by jQuery:


// EDIT, regarding your edit :)

You already gave the answer yourself: use get_stylesheet_directory_uri instead of get_template_directory_uri. The latter points to the base theme (which is the parent theme), while you actually want to load stuff from the child theme (where your stylesheet style.css is located, hence the name).

  • Thanks t f. I updated the question to elaborate the case. Is there any native api to get the style sheet url of the secondary site?
    – noway
    Apr 10, 2013 at 8:36
  • Updated answer according to your edit.
    – tfrommen
    Apr 10, 2013 at 8:40
  • :) Thanks. However it doesnt't help. get_stylesheet_directory_uri returns the URI of the child theme of the main site (themainsite.com), not the secondary site. (foo.com)
    – noway
    Apr 10, 2013 at 8:45
  • Okay, then please elaborate a little on your setup. You have two domains: themainsite.com and foo.com. Where are they pointing at? Different servers (or at least WordPress installs) which both have the parent and child theme installed? Or is it just one WordPress install, and the two websites share the same data, but appear differently according to their different themes?
    – tfrommen
    Apr 10, 2013 at 8:56
  • Thanks for your helps. I fixed it with changing the multi-site setup from sub-folders to sub-domains.
    – noway
    Apr 10, 2013 at 10:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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