I have an existing WP Multisite network. I want to simplify the maintenance of the themes. I'd like all subsites to have the same parent and child theme applied across the network.I saw several posts on WP_DEFAULT_THEME in the wp-config.php file but am unclear what the code would look like when applying both the parent and child to all.
2 Answers
The WP_DEFAULT_THEME
constant actually just overrides what WordPress sets as default theme (which per default is the latest of the bundled themes). It does not really help you to define your parent theme. In fact you just have to "Network enable" your parent and child themes and then set the parent theme in the child themes header. No need to do more than that:
/**
* Theme Name: Awesome Child Theme Name
* Template: parent-theme-folder-name
* ...
*/
The configuration of what is the father theme on WordPress lies on the Child Theme you just need to setup WP_DEFAULT_THEME
to be your child theme.
Now if you want to update all the sites to a theme programmatically you can do the following:
add_action( 'wpmu_upgrade_site', 'p167109_switch_theme' );
function p167109_switch_theme( $blog_id ){
switch_theme( $template, $stylesheet );
}
-
Ok, I'll give both a try on a staging site first. Thanks for the info @Bordoni Commented Oct 31, 2014 at 19:37