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 Reply
    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 Reply
    Roy
    Guest

    Where to put this code??

    #664 Reply
    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 Reply
    Brittany
    Guest

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

    #666 Reply
    Justin
    Guest

    👍👍👍

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