Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

One of the requests on themeforest is that themes are required to provide child theme support.

I know what child themes are, although I haven't worked a lot with them, but I would like to know is there something that my theme must have to support child themes?

share|improve this question
    
Was there a problem creating a child theme for your theme? If you know how to create a child theme then you should know everything there is to know? –  Tom J Nowell Aug 10 '13 at 19:19
    
I created and it works fine, but I wonder if there is anything more that I need to add or test. If that's all than ok. Thanks! –  Valeka Aug 10 '13 at 19:48

2 Answers 2

up vote 1 down vote accepted

From my experience, nearly all themes should support a child theme. I've never had to do any thing specific to a parent theme to make it support a child theme. The WordPress Codex has a good overview of child themes. http://codex.wordpress.org/Child_Themes Hope this helps answer your question!

share|improve this answer

There is already an accepted answer, however, I am going to offer a different answer. There are things you need to do to support proper child theme functionality.

First and foremost, work within the WordPress template hierarchy. I have seen themes do strange things and cook up non-standard templating structures. It isn't even necessary to use any of the WordPress theme system to display content if you really really don't want to. Resist the urge to do any of that.

Second, load files that should be replaceable with get_template_part() and locate_template() and not with PHP's include or require. Files loaded with get_template_part() and locate_template() part can be replaced by child themes. Files loaded by include or require can't.

Third, use get_template_directory(), get_template_directory_uri(), get_stylesheet_directory(), and get_stylesheet_directory_uri() appropriately.

You probably also want to register and enqueue your scripts and stylesheets with wp_register_script, wp_enqueue_script, wp_register_style and wp_enqueue_style.

If you do those things the theme should be pretty pretty child-theme friendly.

Put another way, if you are doing things right in the first place you shouldn't have to do anything special to have a child-theme friendly theme.

share|improve this answer
5  
Exactly. Nothing is more frustrating than working with a theme where styles, scripts and template parts can't be modified by a child theme. –  Michael Dozark Aug 10 '13 at 23:17
    
@ s_ha_dum: well sexplained! –  Tara Aug 11 '13 at 1:10
1  
@Valeka: You should mark this answer as Accepted - such nicely explained by s_ha_dum. Kudos to him. –  Mayeenul Islam Nov 25 '13 at 6:09

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.