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?
- How can I trust switch_to_blog()?
- 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
- Shared table across network
- Changing Multisite themes on mass
- Is there an easy way to separate themes on network?
- Multisite: How to store global options vs. site options?
- 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?
- 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
- Can’t find “Add New” button for themes in a multisite
- Manipulate list of themes in wp-admin
- Subfolder multisite issue. Themes and plugin files 404
- 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?
- How to change the database prefix in multisite (WPMU) install
- Importing Multiple DB to one MU database
- Multisite setup creating custom table
- Is there a way to run upgrade.php for one blog?
- Using Two Themes – One for Main Site, One for Ecommerce
- How to store custom user data on the database?
- 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
- 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
- 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?
- 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
- Update WP install to WP network & it broke the DB connection
- Trying to change active theme on all sites in Multisite
- How to share User Database between Two Multisite Installations + More
- add_blog_option blog ID
- How long is “as long as possible” in wp_cache_set()?
- WPMU on MySQL limited to 1GB of space?
- Questions about MU database schema and how to list all blogs
- 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]
- How does WP decide how to evaluate database integrity
- Create link preview for theme wordpress
- How to use the same users table on multiple wordpress sites
- A database for each category?
- Themes are visible in Network, but invisible in sites
- allow multisite in the installation process
- Error establishing a database connection after moving local wordpressmultisite from one directory to another
- Will resetting my database affect other sites on my multisite WordPress install?
- WordPress theme to support single website but with 3 sections for 3 languages
- WordPress Database Cleanup
- Optimal setup for Multi Domain WordPress with Woocommerce
- WordPress Multisite – Auto enable theme
- Multi-site database upgrade claims success, but db_version not updated
- Whats the best Practice for using a different Theme for WebView Apps?
- Creating a stand-alone site from a WordPress sub site
- Problem in adding new site on WP multisite
- Error establishing a database connection – Multi-site with subsite don’t exisit [duplicate]
- 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?
- WordPress multisite and one database
- WordPress Multisite platform for different city for single db
- HyperDB, Multisite – on new site creation put site’s tables to specific database
- Iterating over every multisite / theme and list the pages