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
- Export/Import Blog Post from and to sites with different themes?
- Create site programmatically for WPMU
- WordPress Multisite allow site admin to add user without email confirmation
- Using one media library for a multisite network with WordPress 3.5 media library
- Troubleshooting a Network site displaying a blank page [closed]
- Add new column to sites page
- Run a function when a new site is created in WordPress Multisite
- Sub-directory blog on a sub-domain WordPress network site
- Customizing Deleted/Archived blogs warning pages
- SQL Query to Get list of all users along with their blogs
- Synchronizing Two WordPress Sites Content
- Multisite Independent User Base
- Why is my multisite installation not showing all the available sites?
- Issue converting single site to multi-site – blogs.dir folder not created
- PHP Notices appear when browsing any page in admin, but only for child theme, using code from WP Codex
- What is the most efficient way to have two “blogs” on one site?
- Preview posts returns 404
- How can I have multiple URLs pointing to single WordPress installation?
- How to exclude a directory from WordPress permalinks in a Multisite environment?
- Redirect subdomain homepage to domain specific page in wordpress multisite
- Make WordPress Search for Both Main Domain and Subdomain
- Create a network of blogs with WordPress 3
- create new site subsite in wordpress multisite by subscriber user instead of network admin
- Retrieving multisite blog IDs, somehow failing to foreach them properly
- Get just subdirectory name from a multisite URL
- Why my deleted url is redirecting to random post?
- Reset a site in multisite
- Redirect Site Geologically
- WordPress Network admin options page: how to store options and where will they be stored?
- Multisite not using subdomains as hostname in from address when sending emails
- Cookie signed verification failed – wp-saving-post
- Do I need a Multisite? [closed]
- Error: reassigning content to a different user is not supported on multisite
- Run additional service on domain with WordPress Multisite?
- Hierarchy in multisite
- Remove superadmin role from the “change role to” menu in user listing
- use get_theme_mod from all sites in network
- Generate HTTPS Urls in multisite
- Replicate network plugins without having to configure it for each subsite?
- If statement in wp-config.php, is it possible?
- WordPress Multisite URLs and Multiple Updates
- Some permalinks are not working and show 404
- Should I use Multi Site to achieve different designs for different sections?
- WP MS: How to query over the network
- unable to access network admin of a blog
- WordPress Multisite Permalinks on mapped domain = server 404 error
- Sites network with sub-folders
- Set my own password when registering a multisite user or site
- Efficient way to fetch all archived WPMS blogs
- Setup another new subdomain root on top of multisite configuration
- WordPress keeps deleting user account for multisite after loggin out i need your help please?
- Change main site / network admin site?
- Serve theme and plugins assets from correct domain on multi-domain multisite
- logging out with/without confirmation – single site, multisite
- Multisite different domains mapping error on GGS
- WordPress Multisite wp-admin/ redirect loop but adding index.php works fine
- Can WP multisite manage multiple ccTLDs
- WordPress Multisite redirect loop
- WordPress Multisite Subsite WP admin not working
- Multiple WordPress sites on one hosting [closed]
- WPMU and Chrimes Family Link app