Fuxia was using update_option
in her answer and it may work, but I wouldn’t recommend that – it isn’t the polite way of setting a theme.
So how I would approach that problem?
First of all, you want to perform this action only once and for all sites. So there is no point in using any hooks. Just run the code once and then delete it.
And that code should loop through all sites and set their theme:
function switch_all_multisite_themes() {
foreach ( get_sites() as $site ) {
switch_to_blog( $site->blog_id );
switch_theme( 'theme' ); // for example 'twentyten'
restore_current_blog();
}
}
switch_all_multisite_themes(); // run this function only once
Related Posts:
- find a random blogid across my multisite network that has at least one post published
- Split a database will improve performance?
- Within the database, where is the flag which says that a user has Super Admin rights?
- Database Tables Lost Indexes? How to Recover?
- Will changing the folder name two directories above a fresh wordpress installation break the site?
- new multisite, old db
- WP MultiSite: Can’t select database error after changing to new domain
- Get multisite count without php?
- WordPress and SQL – Update and Insert from another table if column value doesn’t exist
- MySql Database In WordPress Multisite
- Plugin data shared in Multisite
- Merging versions of wp_posts based on post_title
- How to mass change theme for all Multisite network sites?
- Multisite: merging two subsites in the main site
- How can I trust switch_to_blog()?
- DB connection error after copying a WordPress Multisite instance to a second location
- Allow user to select a theme to install when they signup
- Add WordPress MU Network Admin via Database
- How to tell which database tables belongs to which multisite site
- what are pmxi tables? [closed]
- Shared table across network
- Changing Multisite themes on mass
- Is there an easy way to separate themes on network?
- WP-CLI methods for get_current_blog_id, get_blog_details or $wpdb->prefix
- Multisite: How to store global options vs. site options?
- Built to scale, or worry later?
- Uploading/Deploying a Multi Site Install
- Multisite database upgrade SSL error
- Hide a theme on list of themes in wp-admin without editing core files
- Configure WordPress to read from database only, never write
- Can I install a theme on only one site of a multi-site network install?
- How can I list only sites that use a particular theme or plugin?
- Multiple Domains and Subdomains Using Multisite Installation
- SQL Query to Get list of all users along with their blogs
- Is it possible to fix/repair all Index, Primary Key, Unique (and all other) structure of a WordPress MS Database
- Migrating WPMS from apache to IIS7 causes Database Error
- Synchronizing Two WordPress Sites Content
- 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
- How to clone and locally run a network for testing
- Two WordPress sites sharing the same database
- Subfolder multisite issue. Themes and plugin files 404
- cant enable theme in multisite
- Using $wpdb Class to Pull Recent Comments Across a Network
- Is it possible to import a wordpress backup from a single site in to a multi-site configuration?
- How to Move Local Singlesite Database to Remote Multsite Database?
- Multisite Subdomain Using More Resources Than Others?
- How to change the database prefix in multisite (WPMU) install
- Importing Multiple DB to one MU database
- Make WordPress Search for Both Main Domain and Subdomain
- Does WordPress MultiSite use separate MySql databases?
- Bootstrapping WordPress MultiSite Outsite of WordPress – No $wpdb
- Multisite setup creating custom table
- Is there a way to run upgrade.php for one blog?
- Performance on WPMS
- Using Two Themes – One for Main Site, One for Ecommerce
- Migrating Multisite – Database error, missing wp_blogs table
- How to store custom user data on the database?
- WPML tables not deleted when removing multisite subsite, need help clearing up my sql-file! [closed]
- Removing a wordpress multisite installation and preserving the database before migrate to nginx
- Multi-site get_bloginfo(‘stylesheet_directory’) referring to sub-folder
- Multisite theme control not working
- Installed domain-based Multisite but can’t access wp-admin (redirect loop)
- Pushing stored procedure to a multisite database in WordPress
- Multiple multisite instances connecting to the same database
- Query to import data from one MultiSite table to another (pages/sub-pages)
- WordPress Multisite – can I somehow merge the tables?
- Multisite with subfolders- can’t access main site- Error establishing a database connection
- Create a database for each site created in multisite?
- Use WordPress MultiSite (WPMS) with a remote database for each created site
- WordPress MultiSite Theme
- WordPress Multisite blogs not working after domain swap
- Least expensive way to get table prefix in multisite installation
- Update configured themes
- 2 website 1 database… Local to online
- Obtaining user table for one site on multisite set up
- Removing Mutlisite lines stop DB connection
- Renaming admin user on multisite install by MySQL
- Set up Network Locally on a Flash Drive
- how to migrate wpmu from one host to the other?
- How to show different sub sites based on Member’s user name In word press?
- Share DB tables between two blogs on the same WP Multisite installation
- Does a single theme license work on multisite? [closed]
- How can I create blog specific database table in multisite?
- How many databases do I need?
- How do I display offsite database info on my wordpress site?
- Locking one blog of many in a multi user/blog WordPress installation
- WordPress Multisites or Multiple WP Single sites?
- Create a CSS file in plugin folder when theme is activated
- $wpdb->update prefixes database name to table when executing query
- Delete all user’s meta without knowing all the ‘key’
- Is it necessary to network enable both the parent and child theme for multisite installations?
- Combining user database tables while keeping all other data in seperate for multiple sites?
- How to make multi site with single Database?
- Update WP install to WP network & it broke the DB connection
- Trying to change active theme on all sites in Multisite
- Multisite > Edit Site > Themes – what are these themes?
- Sharing users across multiple sites, each on their own database
- importing data into wordpress db