Skip to content

Instantly share code, notes, and snippets.

@carmoreira
Created August 6, 2018 16:53
Show Gist options
  • Save carmoreira/7a35a86f87c25ea61dc45f7a6c16249c to your computer and use it in GitHub Desktop.
Save carmoreira/7a35a86f87c25ea61dc45f7a6c16249c to your computer and use it in GitHub Desktop.
Get multisite themes being used
if ( function_exists( 'get_sites' ) && class_exists( 'WP_Site_Query' ) ) {
$sites = get_sites();
foreach ( $sites as $site ) {
switch_to_blog( $site->blog_id );
$curr = get_blog_details();
$theme = wp_get_theme();
echo '<h1>' . $curr->blogname . '</h1>';
echo $theme->Name;
$style_parent_theme = wp_get_theme(get_template());
$style_parent_theme_author = $style_parent_theme->get( 'Author' );
echo '<br>(' . $style_parent_theme->Name . ')';
restore_current_blog();
}
return;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment