WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Default Theme and Networks (12 posts)

  1. jw60610
    Member
    Posted 2 years ago #

    Hello,

    I've looked through the forums and see some partial answers to this, but haven't been able to solve it. Here's what I'm trying to do:

    • I want my sub sites to use a specific theme (a child of the TwentyEleven theme)
    • I don't want the sub sites to be able to change the theme back to the parent, which will break all my customizations
    • I want my main site to use another theme, which is ANOTHER child theme of TwentyEleven

    I've seen where you can modify the config.php file to change the default:

    define( 'WP_DEFAULT_THEME', 'twentyeleven');

    and targeting a child theme folder:

    define( 'TEMPLATEPATH', '/wp-content/themes/project-child');

    But that seems to set all of my themes, including my main theme, to the child, which isn't what I want.

    Is there a way to set the default for sub site users at the Twentyeleven child and remove the choice from their view,

    and

    select which theme I want for my main site?

    Thanks very much, in advance.

  2. It's just this:

    define( 'WP_DEFAULT_THEME', 'project-child');

    Then make that the only ACTIVE theme. Thus no one can change away. On your OTHER theme, however, go in via WP Amdin -> Network Admin -> Sites

    Edit the site.

    Go into that theme tab and activate the theme JUST for that site.

    Go back to site.domain.com/wp-admin and pick the theme.

    Beer!

  3. jw60610
    Member
    Posted 2 years ago #

    Would love to have that beer, and buy you one too!

    But after making that change to wp-config.php I get a theme that is unstyled. I'm testing on a local server and have set up a few sites, and oddly, one shows the full styling. But, when I go into the theme settings page it's set to the parent Twentyeleven Theme.

    When I go into the theme settings for the other sites it says:

    The active theme is broken. Reverting to the default theme.

    and, as expected, those "broken" sites have the child theme selected.

    I do have both the project-child theme AND the Twentyeleven parent "Network Activated". Should I deactivate the parent? Doesn't the child theme need the parent to survive? (excuse the analogy ;) )

    Guessing here: is it a path issue with the change made to the config.php file?

    Also, when I add a brand new site to the network, the admin page will show, but the site is a white blank. When I check the Manage Themes page on the new site, it shows a blank for the current theme, and says only: "Options: Widgets", then shows the child theme as an option below.

    J

  4. jw60610
    Member
    Posted 2 years ago #

    One more thing:

    in the stylesheet of my child theme I used:

    @import url('../twentyeleven/style.css');

    To pull most of the original css rules into my child theme.

    Can that be the issue?

    Thanks, sorry for the bump.

  5. I think it's more a case of your child theme is busted.

    Okay quick lesson :D

    You can safely DISABLE the parent theme on your network. So long as you don't delete the FILES on the server, the theme is smart enough to know 'Oh, yes, that's me.'

    It's wp-config.php not config.php, please try to use the right file names so no one gets confused. Yes it matters.

    Now. For Child Themes, you make a folder /2011-child in the theme folder.

    The style.css should be:

    /*
    Theme Name: My 2011
    Theme URI: http://domani.com
    Description: This is a child theme of Twenty Eleven (2011), the 'new' default WordPress Theme.
    Version: 1.0
    Tags: fixed width, widgets, valid CSS, valid XHTML, SEO, SEO friendly, adsense, custom header, three columns, clean,  right sidebar, blue,white, photoblogging, widget ready, simple, gravatars
    Author: jw60610
    Author URI: http://domain.org/
    Template: twentyeleven
    */
    
    /* Get base CSS */
    @import url('../twentyeleven/style.css');

    Did you get all that right?

  6. jw60610
    Member
    Posted 2 years ago #

    Yes, it matters a lot, sorry. I changed the filename above. Typing before thinking ;)

    No my theme's ok, although on the stylesheet I only used the Template: twentyeleven line in the comments. If I select the child theme it displays properly. Really, at this point I've only made one change, to the child folder's functions.php file. Other than that, though I'm going to make a lot more changes soon, it's a stock Twentyeleven theme.

    I'm stumped.

  7. Curtiss Grymala
    Member
    Posted 2 years ago #

    Try adding the additional comments to your child theme's style sheet. I can't recall right now whether WordPress considers a theme broken or not if it doesn't include the necessary information in the style sheet's header. I think Theme Name is definitely required; I'm not sure about the rest. According to the Codex (excerpted below), the whole comment block is required, but I'm not 100% sure.

    The comment header lines in style.css are required for WordPress to be able to identify a Theme and display it in the Administration Panel under Design > Themes as an available Theme option along with any other installed Themes.

  8. I'm pretty sure it's required to be AT LEAST this:

    /*
    Theme Name: My 2011
    Description: This is a child theme of Twenty Eleven (2011), the 'new' default WordPress Theme.
    Template: twentyeleven
    */

    I'd put version in there too. Suffice to say, it works fine for most people, so the problem's most likely to be in your theme.

  9. jw60610
    Member
    Posted 2 years ago #

    Curtiss,

    Thanks man, but I copied and pasted the entire comment blog into my child theme's style.css and it still doesn't work.

    What I get, on any new sites I create in the network, in the Manage Themes page is:

    Current Theme (then blank)

    by (then blank)

    OPTIONS:Widgets (then blank)

    Followed by the desired child theme under "Available Themes", with the full description etc from the quote block in the stylesheet.

    I also removed the functions.php file from the child folder, just in case.

    So, there's no customization whatsoever in the child theme.

    Still getting the above and a blank screen for the site.

    Thanks.

    J

  10. You cannot declare a child theme as the default theme in the config file UNLESS you also declare the same parent theme for all sites in the network.

    Use the new blog defaults plugin to set the child theme as default instead.

  11. Oooh really? I didn't know that!

    I would have thought WP would grab the theme and parse the parent.

  12. jw60610
    Member
    Posted 2 years ago #

    Andrea,

    Thanks so much. Saved me hours of frustration. Works perfectly! Also solves some other problems I was having.

    Thanks also Ipstenu and Curtiss for taking the time to reply.

    Here's the link: http://wordpress.org/extend/plugins/wpmu-new-blog-defaults/

    Although the plugin name says it I just read through the FAQ's and it's important to note that the defaults only work on newly created sub blogs.

    ;)

Topic Closed

This topic has been closed to new replies.

About this Topic