The MU forums have moved to WordPress.org

Select stylesheet according to BlogID (3 posts)

  1. alfredomejia
    Member
    Posted 15 years ago #

    Hi,

    Im thinking the possibility to have a site with the same theme but with different headers, banners, colors, etc.

    I was thinking if there is a way to get the theme to selec a specific stylesheet according to the URL or blogID...

    I found and example on how to do it by season, but my php knowledge is really basic and i cant figure out how to apply it on my situation...

    thanks in advance

    here what i found so far.. http://wordpress.org/support/topic/156012

  2. xenon2050
    Member
    Posted 15 years ago #

    Hmmm, I'm not a php major but I know a bit.
    Okay so...
    What you want to do is change what you found at that link to something like this

    $result = get_blog_details($blogId)->blog_id;
    if($result = 1){
    	$user_css = 'user1';
    }
    elseif($result = 2){
    	$user_css = 'user2';
    }
    <link rel="stylesheet" type="text/css" media="screen" href="<?php bloginfo('template_directory'); ?>/<?php echo $user_css; ?>.css" />

    Continue for as many blogs as you have.
    Not positive if this works but worth trying.`

  3. andrea_r
    Moderator
    Posted 15 years ago #

    Depends on if you have certain criteria for each blog.

    Otherwise, I'd just make a theme that had the custom header option plus changeable stylesheets from the backend.

About this Topic

  • Started 15 years ago by alfredomejia
  • Latest reply from andrea_r