Use switch_theme( 'theme_name' )
to switch a theme
Use wp_get_sites( array('network_id' => $wpdb->siteid) )
to retrieve all sites info including the blog_id
Loop through the retrieved blog ids and execute code within the scope of each blog using the switch_to_blog()
function:
foreach( $blog_ids as $blog_id ){
switch_to_blog( $blog_id );
//Do stuff
restore_current_blog();
}
Related Posts:
- Allow user to select a theme to install when they signup
- Changing Multisite themes on mass
- Is there an easy way to separate themes on network?
- Hide a theme on list of themes in wp-admin without editing core files
- Can I install a theme on only one site of a multi-site network install?
- Can’t find “Add New” button for themes in a multisite
- How to move theme directory but not plugins/uploads out of WordPress root directory?
- Manipulate list of themes in wp-admin
- Subfolder multisite issue. Themes and plugin files 404
- cant enable theme in multisite
- Bulk activate a theme on multisite
- Using Two Themes – One for Main Site, One for Ecommerce
- Multi-site get_bloginfo(‘stylesheet_directory’) referring to sub-folder
- Multisite theme control not working
- WordPress MultiSite Theme
- Update configured themes
- How to show different sub sites based on Member’s user name In word press?
- Does a single theme license work on multisite? [closed]
- Create a CSS file in plugin folder when theme is activated
- Is it necessary to network enable both the parent and child theme for multisite installations?
- Multisite > Edit Site > Themes – what are these themes?
- WordPress multisite with same content
- How to automate setup of theme, pages, widgets, etc for a new site in multi-site?
- Why WordPress w/ Nginx Multisite Only Lets Admin Upload ZIP Plugins But Not Themes? [closed]
- May I do multiple micro-sites with different themes in a single wordpress without subdirectory nor subdomain separation?
- How can I have two or more WordPress Pro (paid) themes that form a single website?
- Create link preview for theme wordpress
- Themes are visible in Network, but invisible in sites
- WordPress theme to support single website but with 3 sections for 3 languages
- WordPress multisite condition for certain blog_id’s
- WordPress Multisite – Auto enable theme
- Whats the best Practice for using a different Theme for WebView Apps?
- Creating a stand-alone site from a WordPress sub site
- Updating themes customized by users
- How to handle responsive and non responsive websites in one WordPress Theme?
- In a MS install, can you allow different users to have their own themes?
- How to mass change theme for all Multisite network sites?
- Iterating over every multisite / theme and list the pages
- different image for mobile template block theme
- What’s the difference between get_site_option and get_blog_option?
- Multisite Domain Mapping with SSL
- Basic Multisite Question – Managing Content Centrally
- WP-Admin not working properly at WordPress multisite with subdirectories
- Multisite – Keep users logged in only to their site
- How to use WordPress multisite with mixed HTTP and HTTPS sites?
- Multisite with Different Domains
- Weird Issue with load balanced WP 3.0 setup
- Removing orphan users in WordPress Multisite
- Sharding BLOGUPLOADDIR
- Hook filter to change wp_upload_dir() path in multisite
- Error 101 after upgrading WordPress
- Copy posts from one blog to another in multisite environment
- SSL for mapped subdomains in multisite (no plugins)
- How to add new sites and map a custom domain in WordPress Multisite?
- 301 Redirects for posts, category, pages from original domain to sub-domain of multisite
- Child Theme CSS Not Overriding Parent Theme In MultiSite Site
- How To Remove Dashboard Menu Items for Multisite Users?
- Can wp-cli display all users and their roles across all sites in a multisite instance?
- How do I add JavaScript that will execute on all my sites in Multisite?
- Create a network of sites
- Free Google Analytics plugin that works with WordPress in network mode (WPMU)? [closed]
- How Access Multiple WordPress sites with a single login
- Adding an existing subfolder site to a fresh multisite in the root, would it cause a problem?
- API for creating blogs on Multisite?
- All subdomains redirecting to mainsite/wp-signup.php after multisite install
- WordPress Multi-Site on Ubuntu 18.04 LAMP Keeps Re-Directing
- How to force change Network site multi language subdirectory base URL?
- Create subdomain out of sight the wp multisite
- How to log out from wordpress multiple site?
- How to protect specific uploaded files from being accessed by non-logged-in users in WP-multisite
- Suspicious mesage appears instead of images
- Include Site 1 Posts in Query for Sub Sites
- When creating a multisite, the sub-folders option is not available
- MU domain mapping subdomain multisite : map a subdomain on another subdomain
- Where are the files that control the multisite user dashboard?
- Issue with WORDPRESS MULTISITE
- How to fix that new users show up again in subsite of a Multisite?
- How long is “as long as possible” in wp_cache_set()?
- Changing from localhost:8888 to localhost
- WordPress multilingual site to work with other plugins
- Error after changing multisite URL
- Multisite Dashboard Always Redirects to Main Dashboard
- Moving from a non WordPress site to a WordPress Site – Login between both sites
- WP Multisite child theme: get_template_directory_uri() seeks it’s own subdirectory instead of directory of parent theme
- Rewriting request to another site
- Multi-Network without plugin
- How install wordpress in another wordpress folder?
- WordPress Multisite header img src is lost from staging to production
- Multi-site Installation in WordPress | Security & Future Migrations
- Get the latest 3 posts across the network
- Blog broken after changing Site/Home URL
- Autoblog posts in wpms(network) into main site including featured images
- Cron job disappering without notice?
- WP Multisite .htaccess interferes with cgi-bin
- Redirect all users, except network administrators, from the main site to a subsite
- load styles and scripts in network admin not working
- How to redirect author subdomain pages to each author pages on www
- Set static page as default front page on newly created sites in multisite
- Custom link color or stylesheets
- Multisite website configure Domain issue