[resolved] Change default theme (15 posts)

  1. w1nk5
    Posted 5 years ago #

    How can you change the default theme that is automatically selected for newly created sites. I tried turning off the twenty ten theme in the Network Themes options but it is still selected as the theme for all newly created sites and requires the user to change the theme manually. Once the desired theme is selected. Twenty Ten disappears. Should I just delete the twenty ten theme or will it be replaced during an update recreating this issue?

  2. Do not delete the theme, please. Yes it will be replaced on upgrade, and no havign a different theme there will not automatically select it.

    Do this:

  3. w1nk5
    Posted 5 years ago #

    This is not working for me. Does it work for making a child theme a default?

    // Change default theme
    define('WP_DEFAULT_THEME', 'dccstore');

    Where 'dccstore' is the folder name housing the child theme. It simply creates the new site with no theme selected.

  4. A link to your site would reeeeeally help.

  5. w1nk5
    Posted 5 years ago #

    It's only on my development machine right now. :(

  6. No special funky capitalization?

  7. w1nk5
    Posted 5 years ago #

    Not sure what you mean by funky capitalization?

    I've tried:

    define('WP_DEFAULT_THEME', 'dccstore');
    define('wp_default_theme', 'dccstore');

    Nothing works.

    define('WP_DEFAULT_THEME', 'dcc'); works like a charm with the parent theme but I cannot get it to work with the child theme!! :(

  8. I mean, in the folder listing, are you using dccStore or something for the folder name? Unix is case sensitive you see :)

  9. w1nk5
    Posted 5 years ago #

    negative... the folder is literally 'dccstore'

    I did find this article: http://www.chriswiegman.com/2010/09/changing-the-default-theme-on-wordpress-3-multi-site/comment-page-1/#comment-496

    However, creating that default-themes.php file and putting it in the mu-plugins folder (I had to create) didn't help.

    I'm stumped.

  10. http://wordpress.org/extend/plugins/wpmu-new-blog-defaults/

    try this plugin. Yes, it could be becasue the theme is a child theme. (tho that would be weird)

  11. w1nk5
    Posted 5 years ago #

    That plugin worked! Thanks Andrea. :)

  12. maverikon
    Posted 5 years ago #

    Here is one more way change default theme, just add this code in functions.php of your theme:

    function change_default_theme($blog_id) {
    switch_theme(‘yourTheme’, ‘yourTheme’);
    update_option(‘current_theme’, ”);
    add_action(‘wpmu_new_blog’, ‘change_default_theme’, 100, 1);
  13. just add this code in functions.php of your theme:

    If it's not the active theme, the code will never run. If you mean put it in the main theme folder... that's nowhere near best practice and likely to cause issues..

    And why use more code to accomplish the same thing? you could use the above code in the mu-plugins folder, once and very quickly, to reset the themes on every single blog though. And why is switch to blog in there???

  14. maverikon
    Posted 5 years ago #

    Yes in functions.php it's bad idea...

    you could use the above code in the mu-plugins folder

    I don't even listen about this folder 'mu-plugins'. You need create it themself?

    About switch_to_blog, when we install new blog we are in scope of main-blog, but we need new sub-blog scope to switch theme...

  15. Use the code I gave about - they already built something for you to do this.

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.