How to set the default theme in WPMU?

By default, WordPress-MU is set to have the Kubrick theme for all new blogs created. If you would like to change this option you have two ways to do that.

The first  involves a small change to the core files of your WPMU installation. Open the wp-admin/upgrade-schema.php file, scroll down to line 293 (on version 1.2.4):

add_option('template', 'default');
add_option('stylesheet', 'default');

Change the name ‘default‘ to the new theme you want it to be.

The second option is the more friendly since it does not involves any changes to the core files. Simply delete, or rename, the default theme and change the name of the theme you want to be the default one to ‘default‘ – that’s it :)


Did you find this post interesting? Please subscribe to my feed.

Comments 8

  1. Rijas wrote:

    Even you can do this by editing wpmu-edit.php (under wp-admin folder)

    Add the following code above Line:126

    $default_theme = ‘default’;
    if(get_theme(‘your_theme_name’))
    {
    $default_theme = ‘your_theme_name’;
    }
    update_option(‘template’, $default_theme);
    update_option(’stylesheet’, $default_theme);

    Posted 17 Mar 2008 at 3:04 pm
  2. Larry wrote:

    Thank you!!

    Posted 27 Apr 2008 at 9:02 pm
  3. Alex wrote:

    Thank you, that was a big help :)

    Posted 15 Sep 2008 at 4:33 pm
  4. Kamran wrote:

    Hello,
    I couldn’t find file wp-admin/upgrade-schema.php file in new version of mu word press.

    Also I couldn’t use the second option. When I renamed, the new default theme didn’t brows completely.

    For option 3, line number 126 is: wp_die( __(‘There was an error creating the user’) );
    and didn’t work when I’ve added above code.
    Is there another option?

    Regards
    K

    Posted 04 Jan 2009 at 7:48 pm
  5. axiom9 wrote:

    Same thing here. The new version doesn’t have the schema file -

    Posted 06 Jun 2009 at 4:56 pm
  6. Frank wrote:

    Hi everyone,

    Just a quick question-do either of these methods change the default for end users or just for the admin?

    cheers!

    Posted 09 Jul 2009 at 4:58 pm
  7. Fairweb wrote:

    It’s not a really good idea to change core files. If you wish to upgrade your WP in the future, all your modifications will be lost. Therefore, you should create a plugin to do this. In my example, I wanted Carrington Blog template as default.

    define (‘MY_DEFAULT_BLOG_TEMPLATE’, ‘carrington-blog’);

    function my_new_blog_template($blog_id) {
    $default_theme = MY_DEFAULT_BLOG_TEMPLATE;
    update_blog_option($blog_id, ‘template’, $default_theme);
    update_blog_option($blog_id, ’stylesheet’, $default_theme);
    }

    add_action (‘wpmu_new_blog’, ‘my_new_blog_template’,10,1);

    Thanks for your post as it helped me to put this together.

    Posted 16 Nov 2009 at 7:43 pm
  8. NIju wrote:

    @fairweb?

    Where should i keep the plugin?

    In mu-plugins or plugins?

    Posted 08 Dec 2009 at 9:53 am

Trackbacks & Pingbacks 1

  1. From Fairweb» Développement Wordpress » Wordpress mu : modifier le choix de thème par défaut lors de la création d’un blog on 16 Nov 2009 at 8:08 pm

    [...] choisi par défaut. Pour indiquer un autre thème par défault, j’avais trouvé une piste sur Ring of Blogs qui m’a bien aidée à trouver une solution. Cependant, il est important de ne jamais [...]

Post a Comment

Your email is never published nor shared. Required fields are marked *