[wp-hackers] WPMS sharing child theme elements

Nicholas Ciske nl at thoughtrefinery.com
Sat Sep 14 17:47:04 UTC 2013


A child theme can be active on any number of sites (or none) or all. It's best to consolidate as much as possible and avoid duplication when using the same theme across multiple sites.

I usually do this via one or more network activated functionality plugin(s) that handle all the common functions, loads common css/js, etc. Your blog id => settings conversion would go here. A "site option" would probably be the best place to store those settings (one per site, or one big array of sites and their settings). Or, just have a big switch statement in your common plugin file that sets things up based on blog id and avoid the DB altogether (if things rarely change).
http://codex.wordpress.org/Options_API

Genesis also has a style chooser option you can use to define sets of css to be selected per site (usually used for color schemes, but can be anything you choose). I've used it for brands, event locations, etc. to set the logo/colors/fonts per site. 
http://www.wilwebs.com/how-to-add-color-schemes-to-a-genesis-child-theme/

_________________________
Nick Ciske
http://thoughtrefinery.com/
@nciske	

On Sep 13, 2013, at 2:15 PM, Jayson T. Coté wrote:

> Whats the best way to share child theme elements in WPMS?
> 
> My client is using the Genesis Framework with child themes for each blog.
> Every Child blog is using the same child theme with some slight variations,
> different CSS, template functions, nav menus, widgets etc.
> 
> 1) As WPMS is configured to have multiple independent blogs, 
> can blogs share the same installation of a child theme or do they need
> to have their own version installed?
> 
> I would like to make global changes that will affect all sites.
> 
> Then to deal with the unique elements in the child themes,  I was thinking of creating
> theme settings that would allow for the variables to be stored in a db table and then
> called into the child theme using the blog id as the identifier.
> 
> I know I can create a plugin to network activate to install to each theme,
> but the goal is to control all child theme data from one location?
> 
> For Example:
> 
> Blog ID	Logo File		GA ID		Sidebar		Widgets
> 
> 1		logo1.png		ua-123455	sidebar-1.php	Featured Posts, Custom Menus
> 2		logo2.png		ua-123456	sidebar-2.php	Featured Posts, Archives
> 3		logo3.png		ua-123457	sidebar-3.php	Featured Posts, Search, Twitter
> 
> Has anyone dealt with this type of scenario?  I would love to hear your insight!
> 
> - Jayson



More information about the wp-hackers mailing list