WordPress.org

Make WordPress Core

Opened 5 years ago

Last modified 5 months ago

#31693 new feature request

Feature Request - Child theme as standard feature

Reported by: W.P. Ginfo Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.1.1
Component: Themes Keywords: close
Focuses: Cc:
PR Number:

Description

I've been active on the Dutch and Intl for ~4yrs attempting to answer questions by new WP-users.

Time and time again WP-users -both newbies and those a bit more experienced- find themselves in some difficulty when they make alterations to their chosen PARENTtheme.
As is well known, this will give considerable hassle when maintaining / upgrading themes...

Although plugins such as 'One Click Child-theme-plugin' are available, many newbies find it difficult / 'scary' to install it. They also frequently make many mistakes, when a CT is made using a code-editor. It gets even more difficult if they then need to transfer any previous 'alterations' and / or 'repair' the PARENTtheme.

I am convinced WP would be both 'easier' and more safe, if the childtheme functionality would be included as a standard feature. It would certainly make the life of WP-support much easier.

== == concrete…

When ACTIVATING any theme,
<ul><li>a CHILDTHEME would either automatically be generated and activated</li>
alternatively
<li>a 'tick-box' wordt be displayed where you can DECLINE to automatically install a childtheme for the newly activated theme</li></ul>

I'd be intersted in your views regarding this issue.
Kind regards,

W.P. Ginfo

Change History (10)

#1 @dd32
4 years ago

  • Component changed from Upgrade/Install to Themes

#3 @obenland
4 years ago

  • Summary changed from Feature Request - CHILDtheme as STANDARD-FEATURE to Feature Request - Child theme as standard feature

#5 @Shapeshifter 3
4 years ago

Even though I currently use this GREAT plugin to create Child Themes: https://wordpress.org/plugins/child-theme-configurator/. I agree with this request from W.P. Ginfo with some additional thoughts:

1.) How about integrating the above plugin into Core?

2.) If not, Learn from what it's Developer has already accomplished.

3.) Let all Theme Developers know up-front, which method of Stylesheet Configuration will be used by Core Default:

  1. Handled by Primary Theme?
  2. Enqueued Parent Stylesheet?
  3. Enqueued Both Parent and Child Stylesheets?
  4. @imported Parent Stylesheet?

4.) It be nice if Standard Default Child Themes also worked for themes designed by Automattic, and offered in the .org Themes Directory.

5.) Maybe Automattic can slip some money to the first mentioned plugin's Developer, to reward him for all of the efforts he's already put into his own well thought-out solution.

(Just some additional thoughts to make things run Standard & Smoothly).

#6 follow-up: @helen
4 years ago

I feel fairly certain there's a duplicate of this somewhere - I don't know that having the feature shown by default is the right thing to do (scary for users who don't know what it means), but maybe we could prompt or show some kind of message about creating a child theme or using something like a custom CSS plugin when somebody goes to edit theme files in the admin. We'd have to consider how you would detect a theme that isn't already a custom one, as then the prompt would just be annoying.

#7 in reply to: ↑ 6 @Shapeshifter 3
4 years ago

Replying to helen:

I feel fairly certain there's a duplicate of this somewhere - I don't know that having the feature shown by default is the right thing to do (scary for users who don't know what it means), but maybe we could prompt or show some kind of message about creating a child theme or using something like a custom CSS plugin when somebody goes to edit theme files in the admin. We'd have to consider how you would detect a theme that isn't already a custom one, as then the prompt would just be annoying.

Sorry for the duplication...I first tried to post this through the Alpha/Beta Support Forums, but Ipstenu (Mika Epstein) closed out my entry and advised that I come back here. Then, I tried to edit my first two sentences here, and somehow things got duplicated.

At any rate, if you don't feel comfortable with Default Core Child Theme integration, how about some sort of heavily required Stylesheet Standard that All Theme Developers should follow for optional end-user Child Theme creation?

Last edited 4 years ago by Shapeshifter 3 (previous) (diff)

#8 follow-up: @greenshady
4 years ago

Having done child themes for 8 years now and being one of the first people to promote the usage of them, I feel pretty confident in saying that this is not something ideal for core. I've been able to see all the pitfalls and gotchas that plague users. As an admin on the Theme Review Team, I can also tell you that such a feature would certainly break a large number of sites at this time.

There really has to be a lot of assumptions made about the [parent] theme if core is going to start auto-generating child themes. Namely, how styles are loaded is a major issue. Theme authors have differing views on this, and many of them (including myself) are passionate about their own method.

Not to mention, we'd still need to get theme authors to figure out the difference between the "stylesheet" and "template" directories. I routinely catch themes utilizing the wrong function. However, we've made great strides in correcting this with the Theme Review Team. One fatal error caused by a theme author using require_once( get_stylesheet_directory() . '/some-file.php' ) is one fatal error too many because the blame gets shifted away from the theme onto core.

When it comes right down to it, child themes are the secondary, not primary, method that we should be promoting to users. Something like Jetpack's custom CSS module or another CSS plugin is a far better method for today's average user. Once a user feels comfortable enough modifying anything beyond CSS (e.g., PHP within the theme files), they really should be comfortable creating a basic child theme or using something like the Child Theme Configurator plugin.

A dismissable message on the theme editor in the admin that the user is about to edit their theme files is a better solution to me. This could include a link to a page on WordPress.org about using a CSS plugin or creating a child theme.

#9 in reply to: ↑ 8 ; follow-up: @Shapeshifter 3
4 years ago

Replying to greenshady:

There really has to be a lot of assumptions made about the [parent] theme if core is going to start auto-generating child themes. Namely, how styles are loaded is a major issue. Theme authors have differing views on this, and many of them (including myself) are passionate about their own method.

Justin,

Do you have any thoughts or recommendations on how to "force", "strongly recommend", or "mandate" how ALL Theme Developers should load Styles into their Parent themes using a Single Standard Method (it seems to me that Child Theme Plugin Authors would then have less issues to deal with if a Standard Method was supplied to them from the Parent themes)?

Sorry if I sound like a Dictator, but in this topic I prefer Uniform Structure over Chaos.

Last edited 4 years ago by Shapeshifter 3 (previous) (diff)

#10 in reply to: ↑ 9 @greenshady
4 years ago

Replying to Shapeshifter 3:

Do you have any thoughts or recommendations on how to "force", "strongly recommend", or "mandate" how ALL Theme Developers should load Styles into their Parent themes using a Single Standard Method(it seems to me that Child Theme Plugin Developers would then have less issues to deal with if a Standard method was supplied to them from the Parent themes)?

I actually don't think we should be mandating this at all. There's two, equally-valid camps here:

  • Those who decide in the parent theme to auto-load the parent theme style when a child theme is active.
  • Those who leave it to the child theme to make the choice of whether to load the parent style.

In general, I go for the first camp. I have strong recommendations on how that should be done, which is what I've outlined here: http://justintadlock.com/archives/2014/11/03/loading-parent-styles-for-child-themes

One method is not any better than the other. They're just different methods. Each has its own purpose and use cases.

#11 @swissspidy
3 years ago

  • Keywords close added

I don't think this is suitable for core, as the average user doesn't necessarily know what a child theme is. Giving them an option to create a child theme on install (or even automatically create one behind the scenes) doesn't make that any better.

As mentioned, parent themes behave very differently too, likely causing unexpected behaviour if such a change would be implemented in core.

A dismissable message on the theme editor in the admin that the user is about to edit their theme files is a better solution to me. This could include a link to a page on WordPress.org about using a CSS plugin or creating a child theme.

+1 to that. Should be a new ticket though.

Note: See TracTickets for help on using tickets.