views:

17

answers:

2

I need an easy way to load the same style sheet for two different installations of wordpress. One is at main.com and the other is at main.com/secondary. Thanks.

+1  A: 

Hardcode your stylesheet link to wherever it's actually stored.

<link rel="stylesheet" type="text/css" href="http://example.com/css/yourstylesheet.css"&gt;

Don't use a relative link that looks like css/yourstylesheet/.

Paul McMillan
Thanks for replying.<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />
aparente001
Look in the source code for your page and see what that actually renders out to. Then substitute that in instead of the dynamically generated content that php code returns.
Paul McMillan
Thanks, but the import method (below) works better in wordpress. The whole point of using wordpress is the dynamically generated content.
aparente001
Sure, that works fine. It's not any more dynamic, given that all you're doing is writing the php tag which renders to the exact same CSS link tag, but if you prefer that syntax, more power to you.
Paul McMillan
(and if you dislike including the URL in your link, just base the path from the root of your domain by starting with a /. `/wp-content/themes...`)
Paul McMillan
Oh. I guess you're saying I don't have to use bloginfo() in the header, I can tell it exactly what file to link.... (My first comment came out a little garbled, with some words missing, but I guess you figured out what I meant.)
aparente001
+1  A: 

I got it! Inside main.com/secondary/wp-content/themes/mytheme/style.css, I removed all the code and inserted

@import url(main.com/wp-content/themes/mytheme/style.css);

and then added some code for the specific secondary banner. This of course overrides the banner definition in the imported file because of the cascade.

I would like to credit themeshaper.com/wordpress-child-theme-basics/ which gave me the basic idea. (I'm sort of doing the opposite of a child theme.)

aparente001