Skip to content

Instantly share code, notes, and snippets.

@stillatmylinux
Last active April 20, 2019 15:18
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save stillatmylinux/6f8eb95ee672063e4b57bb5fb5299c56 to your computer and use it in GitHub Desktop.
Save stillatmylinux/6f8eb95ee672063e4b57bb5fb5299c56 to your computer and use it in GitHub Desktop.
<?php
/**
* @author AppPresser
*
* Lets you use different child themes for multisite.
*
* Needs to added as a mu-plugin. So create a new file and
* place it in the wp-content/mu-plugins/ folder.
*
* Name your child theme folders using the blog id:
*
* app-theme-14, but remove the ion-ap3-child theme.
*/
function my_app_child_theme( $theme_slug ) {
$new_theme_slug = 'app-theme-' . get_current_blog_id();
$child_theme = wp_get_theme( $new_theme_slug );
if ( $child_theme->exists() ) {
$theme_slug = $new_theme_slug;
}
return $theme_slug;
}
add_filter( 'appp_theme', 'my_app_child_theme' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment