ThemeShaper Forums » Thematic

[closed]

Different Stylesheet on Main Page (of subdomain blog on MU)

(9 posts)
  • Started 4 years ago by awarner20
  • Latest reply from awarner20
  • This topic is not resolved
  1. Hi all,

    I've been building a site on WPMU using separate Thematic child themes for the individual subdomain blogs. On the home page of the main blog, I am calling in a different stylesheet using a function I learned here on the forums some time ago. I have a subdomain blog that needs to use this same process, but instead of calling the different stylesheet that is in this subdomain blogs's child theme folder, it is calling the stylesheet that is in the main blog's child theme folder. I've tried changing the function but without success. I wonder if anyone here can offer advice?

    Here is my breakdown of sites. Each site uses it's very own child theme.

    English Sites
    main.com
    residential.main.com
    commercial.main.com

    French Sites
    french-main.com
    french-residential.main.com
    french-commercial.main.com

    The site that is not pulling the correct stylesheet is french-main.com. I'm expecting it to call the stylesheet from the child theme folder for this blog, but it's calling from the main site child theme folder instead.

    Expected:
    <link rel="stylesheet" type="text/css" href="http://french-main.com/wp-content/themes/thematic-french-main/style-home.css" />

    Actual:
    <link rel="stylesheet" type="text/css" href="http://french-main.com/wp-content/themes/thematic-main/style-home.css" />

    It's picking up the correct blog url, but it's not picking up the correct child theme directory.

    Here's the function:

    /*******  USING DIFFERENT STYLESHEET ON HOME PAGE  ********/
    // filter thematic_create_stylesheet to implement your own stylesheets
    function my_stylesheet($content) {
    	// We test if we're on home or on your frontpage
        //if (is_home() || is_front_page()) { <---Use this for multiple pages.
        if (is_front_page() || is_page('main-test')) {
      	// yes, we are .. now let's load the 3c-fixed layout
    		$content = "\t";
    		$content .= "<link rel=\"stylesheet\" type=\"text/css\" href=\"";
    		$content .= get_bloginfo('stylesheet_directory') . "/style-home.css";
    		$content .= "\" />";
    		$content .= "\n\n";
      } else {
      	// we are not .. let's load the 2c-r-fixed layout
    		$content = "\t";
    		$content .= "<link rel=\"stylesheet\" type=\"text/css\" href=\"";
    		$content .= get_bloginfo('stylesheet_directory') . "/style.css";
    		$content .= "\" />";
    		$content .= "\n\n";
    	}
    		// $content will be handed back to thematic_create_stylesheet
        return $content;
    }
    // connect the filter to thematic_create_stylesheet
    add_filter ('thematic_create_stylesheet', 'my_stylesheet');

    I would appreciate any thoughts you might have.

    Posted 4 years ago #
  2. Your call looks right on first glance. Are you sure that the correct child theme is selected from the admin panel for that site? That would be my first thought.

    Posted 4 years ago #
  3. Thanks Devin, but I am 100% sure that the correct child theme is activated. I've triple checked.

    And to make it even stranger, as a test, I changed this line:
    $content .= get_bloginfo('stylesheet_directory') . "/style-home.css";

    to this:
    $content .= get_bloginfo('stylesheet_directory') . "french-main/style-home.css";

    ...to try and force the theme directory location, but it doesn't have any effect on the actual url. It remains:
    <link rel="stylesheet" type="text/css" href="http://french-main.com/wp-content/themes/thematic-main/style-home.css" />

    One thing I will try is to rename the style-home.css to style-home-french.css and then try putting that in the main blog child theme folder.

    Somehow, this function is defaulting to the main blog child theme folder even though, by all accounts, it shouldn't be.

    Posted 4 years ago #
  4. I've tried everything I know. I cannot get the correct stylesheet to be called...but even stranger, it seems that FF is the only browser with this problem. In Safari, IE6, and IE8, the style is being called from the correct child theme location.

    I have no idea why this would be. Of course I've cleared my browser cache several times, closed, rebooted, etc.

    Why would some browsers respect a function and one not?

    Posted 4 years ago #
  5. Grrrrr...yesterday I checked in Safari and it called the style-home.css from the correct child theme directory. This morning it doesn't. It called the style-home.css from the main blog's child theme directory.

    I just rechecked IE8...and it pulls from the correct child theme directory!

    What in the world could be going on here?

    Posted 4 years ago #
  6. I just tried hardcoding the url into the function...and that didn't work either, it still kept pulling in the style-home.css from the main blog's child theme directory. It's like this french child theme isn't even seeing this function???

    function my_stylesheet($content) {
    	// We test if we're on home or on your frontpage
        //if (is_home() || is_front_page()) { <---Use this for multiple pages.
        if (is_front_page() || is_page('main-test')) {
      	// yes, we are .. now let's load the 3c-fixed layout
    		$content = "\t";
    		$content .= "<link rel=\"stylesheet\" type=\"text/css\" href=\"";
    		$content .= "http://french.main.com/wp-content/themes/thematic-french-main/style-home.css";
    		$content .= get_bloginfo('stylesheet_directory') . "/style-home.css";
    		$content .= "\" />";
    		$content .= "\n\n";
      } else {

    Oh by the way, I just realized I mis-typed the main French site location in my first post above. The correct location is:
    http://french.main.com

    Maybe this makes a difference?

    Posted 4 years ago #
  7. Does anyone have any idea why this may be happening or anything else I could try?

    Posted 4 years ago #
  8. Hi Adam,

    send me your Child Theme and I'll take a look at it.

    Chris

    Posted 4 years ago #
  9. Hi Chris,

    I was out of town and just saw your reply here. I'm putting together an email with my child theme attached...

    Posted 4 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.