using single theme with variations, multisite


I have a multisite project. Each site is very similar design/theme wise, but with some variations (fonts, colors). Didn't seem to be best to make new child themes for each stnce the variations are aso few. Instead, I created this function:

// This function is to allow single stylesheet for multiple sites.

add_action( 'init', 'add_blogname_to_body' );

function add_blogname_to_body(){
  $this_blog = get_bloginfo($show = 'name');

  beans_add_attribute( "beans_body", "class", $this_blog );
}

}

The data id could be more specific than body, but you get the idea. Now I can use te single theme with small variations in a single stylesheet rather than managing multiple themes.

Any thoughts on this solution?


That's the best solution!

btw, the wrapper function isn't necessarry for this case, call it directly

beans_add_attribute( "beans_body", "class", get_bloginfo( 'name' ) );


Ah yes! Very nice. I will refactor. Thanks.

Write a reply

Login or register to write a reply, it's free!