WPDIR
Everything and everyone WordPress

Mass activate or change WordPress theme for all Multisite child sites?

  • This topic is empty.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #606
    Roger
    Guest

    genius little snippet:

    function switch_all_multisite_themes() {
        foreach ( get_sites() as $site ) {
            switch_to_blog( $site->blog_id );
    
            switch_theme( 'twentyeleven' );
    
            restore_current_blog();
        }
    }
    switch_all_multisite_themes();  // run this function only once

    https://wordpress.stackexchange.com/questions/54543/how-to-mass-change-theme-for-all-multisite-network-sites

    #633
    Roy
    Guest

    Where to put this code??

    #664
    Elijah
    Guest

    Where to put this code??

    You can add to your main site theme in the functions.php file temporarily and refresh the page on frontend, then it should work.

    After that delete the snippet

    #665
    Brittany
    Guest

    someone should extend this function into other useful tasks for WP Multisite

    #666
    Justin
    Guest

    👍👍👍

Viewing 5 posts - 1 through 5 (of 5 total)
Reply To: Mass activate or change WordPress theme for all Multisite child sites?