Make WordPress Themes

Tagged: Child-Themes Toggle Comment Threads | Keyboard Shortcuts

  • Chip Bennett 3:26 pm on February 15, 2013 Permalink | Reply
    Tags: , Child-Themes,   

    Child Theme Support 

    I have just added a draft section to the Theme Review Guidelines, to cover requirements for Child Theme support/facilitation for hosted Themes:

     

    • Themes are required to facilitate the use of Child Themes. A “basic” Child Theme (i.e. a style.css with Template header tag and @import() of the Template style.css), when activated, should function exactly as the Theme itself functions.
    • Themes are required to include functional and resource files in a manner that facilitates the use of Child Themes:

     

    Based on discussion on the mail-list, consensus appears to be that facilitating end user use of Child Themes is beneficial, so this discussion is the first step in incorporating Child Theme support into the Guidelines.

    Please discuss. Do you agree/disagree that Child Theme support should be added to the Guidelines? Are the above Guidelines sufficient? What should be added/removed/changed? What about pluggable/filterable functions?

     
    • Srikanth 3:31 pm on February 15, 2013 Permalink | Reply

      I would agree with the above as required and anything else optional. Don’t want a lot of additional burden.

      • Chip Bennett 3:34 pm on February 15, 2013 Permalink | Reply

        Agreed. We don’t want to add onerous burden. We simply want to ensure that developers are accounting for Child Themes, which primarily boils down to proper use of get_template_directory_uri() vs get_stylesheet_directory_uri().

        • Srikanth 3:38 pm on February 15, 2013 Permalink | Reply

          Yes, Beginners like me would be happy to cater to new bloggers and leave the complicated stuff to heavy hitters :)

    • nofearinc 3:34 pm on February 15, 2013 Permalink | Reply

      Looks good to me. Maybe there should be an option for very large themes with ‘fat’ frameworks to explicitly warn people that due to theme options or anything else child themes are not supported, but the rule should be required as defined above.

      • Chip Bennett 3:38 pm on February 15, 2013 Permalink | Reply

        Do you foresee particular issues with Child Theme support with Themes that incorporate framework (i.e. code library) code? Is there any particular reason that such Themes should be exempted from this guideline? My initial reaction is that I don’t see any reason to allow for such an exemption, but I am always looking for unintended consequences.

        • nofearinc 3:51 pm on February 15, 2013 Permalink | Reply

          I’m just trying to be safe when a large framework (similar to PageLines) is getting ready to be released for free and reach hundreds of thousands of downloads and is self-sufficient (theoretically). It’s not 100% required, but sometimes the changes could take a significant time for a product that’s ready and working without a further need of files being changed.

          • Edward Caissie 4:04 pm on February 15, 2013 Permalink | Reply

            Within reason, if a “large framework” is being released and the Theme Author thinks its Child-Theme friendliness may be in question then perhaps it should be the recommendation to have some sort of documentation included / referenced to help alleviate any pain points.

            I do not see any requirements for “exemptions” as the Theme Author (hopefully) knew what they were doing when they created and chose to release their “large framework” and within reason should have taken into account Child-Themes by default.

            • nofearinc 4:16 pm on February 15, 2013 Permalink

              your ‘documentation’ was my ‘explicitly warn people’ idea. I don’t say it must be a rule, I’m raising the question for discussion as I’ve personally encountered themes that are not child theme compatible, working properly and switching between get_template_directory_uri/get_stylesheet_directory_uri is not enough. We could just drop that option and discuss again in the mailing list IF any theme falls in that scenario.

            • Chip Bennett 4:19 pm on February 15, 2013 Permalink

              My concern there is: is this truly a special case, or did the framework developer simply fail to account for Child Themes? Is there some extenuating circumstance about the Theme that would preclude the use of Child Themes?

            • nofearinc 4:23 pm on February 15, 2013 Permalink

              the simple case in point is:

              1. a theme has already been built with numerous options
              2. every popular option that most child themes cover (logo type/position, footer, credits, whatever) is covered by theme options
              3. switching to get_stylesheet_directory_uri() is breaking the current design in a way that it’s not trivial to convert it (might take like a couple of days, or 2 weeks, for full compatibility).

              Probably an edge case, but since usability and UX are trendy and more and more themes incorporate option frameworks, that doesn’t sound that absurd to me.

            • Chip Bennett 4:26 pm on February 15, 2013 Permalink

              The part I’m struggling to grasp is: how does switching from get_stylesheet_directory_uri() to get_template_directory_uri() cause breakage for a stand-alone (i.e. Parent, i.e. Template) Theme? For a stand-alone Theme (i.e. not a Child Theme), both functions return the same URL.

              So, any potential breakage would have to derive from some other development element/criterion on the Theme.

            • nofearinc 5:48 pm on February 15, 2013 Permalink

              Chip, it’s not that it’s breaking the theme if you do the switch. There are just random stylesheets applied after the so called style.css where the child theme can’t take over the restyling or there is a router responsible for managing the template generation.

              With that said, point 1 contradicts point 2, or rather executing point 2 won’t lead to a child theme support.

              Again, it might be an edge case, there are just too many ways implemented in themes and frameworks out there for styling and template generation that are not fully compatible. We might reject all of them for that ‘freestyle’, the question is should we do it if it’s unlikely for people to ‘inherit’ it with a child theme.

            • Justin Tadlock 6:05 pm on February 15, 2013 Permalink

              There are just random stylesheets applied after the so called style.css where the child theme can’t take over the restyling

              The only thing that we’d need to worry about is if the child theme’s style.css is loaded. The other stylesheets are irrelevant in terms of this discussion. They’re a part of the theme design. Nowhere is it required nor should it be that a child theme must be able to overwrite all elements of a parent theme.

              or there is a router responsible for managing the template generation.

              As long as the template are using the proper template-loading functions, I don’t see a problem here.

            • nofearinc 6:09 pm on February 15, 2013 Permalink

              Justin, I do agree with you, but most people expect that a child theme could override everything.
              We should leave all doubt out of the door and either set strict rules, or just elaborate on what could a child theme do. Does that make sense?

            • Chip Bennett 6:27 pm on February 15, 2013 Permalink

              But we also require that all stylesheets other than style.css be enqueued, rather than hard-coded. So, a Child Theme can always dequeue any subordinate stylesheets (or dynamic CSS functions, or scripts, for that matter).

            • Justin Tadlock 6:38 pm on February 15, 2013 Permalink

              Justin, I do agree with you, but most people expect that a child theme could override everything.

              Most of my users don’t expect a child theme to be able to override everything. I’ve been doing child themes a lot longer than most people here, and I can count on one hand the number of users who have asked about something like that.

              We should leave all doubt out of the door and either set strict rules, or just elaborate on what could a child theme do. Does that make sense?

              1) A child theme must be able to overwrite any parent theme template (not any file, just templates).

              2) A child theme’s style.css file must be loaded using the get_stylesheet_uri() function.

              Both of these things are already covered under the Theme Review requirements, so we already have the rules in place.

            • nofearinc 6:42 pm on February 15, 2013 Permalink

              I do agree with both last statements by Chip and Justin. The child theme can indeed dequeue if needed.

    • ZaMoose 3:39 pm on February 15, 2013 Permalink | Reply

      We should create aliases within the code for `get_parent_theme_uri()` and `get_child_theme_uri()` to adhere to the WordPress-should-be-read-as-close-to-English-as-possible goal.

    • Edward Caissie 4:05 pm on February 15, 2013 Permalink | Reply

      Just grabbing my mailing list reply …

      Those guidelines look fine.
      I like the idea of how a “basic” Child-Theme is spelled out, and I think you covered the use of the the `template` versus `stylesheet` usage.

    • @mercime 5:48 pm on February 15, 2013 Permalink | Reply

      You got my YES vote :-)
      Thanks Chip.

    • Justin Tadlock 5:57 pm on February 15, 2013 Permalink | Reply

      As far as I’m concerned, the guidelines already require and have required for a long time that themes be child-theme ready. We already require all functions and hooks to be used properly.

      The only four functions you must worry about are:

      • get_template_directory()
      • get_template_directory_uri()
      • get_stylesheet_directory()
      • get_stylesheet_directory_uri()

      If you’re using a stylesheet function in your theme, you’re probably doing it wrong and shouldn’t pass the current guidelines. Of course, that’s a generalization, but it’s usually a good rule of thumb to go by.

      • Chip Bennett 6:28 pm on February 15, 2013 Permalink | Reply

        I agree ,and I’ve made related comments in Theme reviews. Most of the time, the developer just didn’t know why one should be used rather than the other, and was happy to make the change.

        This discussion is mainly an effort to formalize what you and I (and probably others) have interpreted from existing guidelines.

  • Edward Caissie 3:00 pm on April 9, 2011 Permalink
    Tags: , Child-Themes,   

    Child-Themes will now be considered for inclusion into the WordPress Extend Themes repository.

    Note: Child Themes are not currently being considered for inclusion in WordPress Extend.

    Please be sure to read the Theme Review process and guidelines; also, please note the additional Child-Theme guidelines before submitting a Child-Theme for consideration.

    Please note, although at the time of this writing the upload script may note the Child-Theme “fails” as the criteria used for Child-Themes is slightly different. If the Child-Theme did actually pass you would see at the bottom of the upload acknowledgement page a reference to the new Themes Trac ticket as well as receiving an email referencing the ticket as well.

    You will also be able to check the open status of the Child-Theme in this Trac report: http://themes.trac.wordpress.org/report/6

     
    • Andrew Nacin 11:23 pm on April 9, 2011 Permalink

      Please consider icing this proposal until further discussion.

      I don’t recall formal rules on this. This post was submitted for discussion only, and some of the points there had some extensive discussion in the comments. Some of those proposals shouldn’t make it into the guidelines.

      I’ve mentioned previously that we shouldn’t support child themes officially, until core supports them. Otherwise we’re going to confuse users. I’ve asked other members of the core team to weigh in further, as I’m pretty sure we’re in agreement on this.

      • Andrew Nacin 11:23 pm on April 9, 2011 Permalink

        until core supports them.

        Which, by the way, will likely possibly be 3.2. This can wait.

    • jane wells 11:24 pm on April 9, 2011 Permalink

      Hi guys. Actually, it’s pretty important from a ux perspective for us to wait on this until we have support for child themes in core (matching to parent, checking dependencies, etc). Please hold off on this, and bring it up at the next dev chat.

    • Otto 11:43 pm on April 9, 2011 Permalink

      Just weighing in to say that from the viewpoint of the themes directory code itself, it’s ready to go. We’ve tested it and the child-theme support there works. There may be a few tweaks, but no major changes are required. The only remaining question is regarding the support for dependency checking and such in the core.

      • Edward Caissie 12:00 am on April 10, 2011 Permalink

        This is the reasoning I relied on to go forward with Child-Themes in the repository; as well as the premise Child-Themes themselves should be as readily accessible in Extend as their respective current Parent-Themes are.

        • Emil 10:29 pm on April 12, 2011 Permalink

          So is this yey or nay for Children?

  • Peter Westwood 12:16 pm on March 11, 2011 Permalink
    Tags: buddypress, Child-Themes   

    I thought we already allowed child themes for BuddyPress as an exception to the rule?

    This ticket http://themes.trac.wordpress.org/ticket/2996 was an update for http://wordpress.org/extend/themes/buddypress-widget-theme and was just rejected for being a child theme – I would have re-opened the trac ticket and commented there but I don’t have the rights to do that on the Theme Review trac.

     
    • Chip Bennett 1:02 pm on March 11, 2011 Permalink

      Reopened

    • modemlooper 5:29 pm on March 11, 2011 Permalink

      Thanks, this has been an ongoing issue and the result is the BuddyPress theme developers have not updated child themes and the majority of them are now outdated and broken on current version of WordPress and BuddyPress.

      There really should be a BuddyPress theme developer reviewing BuddyPress themes there are many things a BP in the repo should include besides WP functionality. If some creates a child theme and it breaks a default BP component this needs to be addressed. Currently it seems the reviews are only checking for WP requirements. BP tacks on many other functions that should be included.

      • Edward Caissie 2:30 am on March 12, 2011 Permalink

        We’ll be happy to have more community involvement with the Theme Review process, especially the BuddyPress Themes as they tend to be few and far between currently.

    • Emil 1:09 am on March 12, 2011 Permalink

      That was a mistake from my end and I apologize for that. Ticket reopened by Chip and approved by me early this morning.

      Thanks,
      Emil

      • Peter Westwood 10:51 pm on March 12, 2011 Permalink

        No worries – this is a learning process for every one of us :)

c
compose new post
j
next post/next comment
k
previous post/previous comment
r
reply
e
edit
o
show/hide comments
t
go to top
l
go to login
h
show/hide help
shift + esc
cancel