Applicable to : All Themes

Child Theme

Video Guide – Child Theme

 

Child theme : safest and easiest and only recommended way to modify parent (main) theme files.
This is WordPress’s default provision.

  • If you do not have customization other than custom CSS, you could skip this.
    Use additional CSS tab of customizer, to add custom CSS.
  • If you have modifications which are not possible without editing theme files, use child theme.
  • Theme comes with child theme.
  • Child theme inherits the functionality of another theme : Parent theme (Installable theme you have got with download).
  • Child theme allows you to modify, or add to the functionality of that parent theme.
 

It is not advised to change main theme’s files. Those will get replaced for the new updated files while updating theme.
No support will be provided for update queries if you have changed main theme files itself.


This does not apply to the WP Customizer and WordPress settings, data you have entered in pages, posts etc.
If you didn’t touch the theme’s files you don’t need to worry about it.

 
How to install Child theme?
WP Admin Upload
  • Upload parent (main theme) first. Discussed earlier under installation guide.
  • Upload and activate child theme zip as normal WordPress theme as discussed earlier under installation guide for main theme.
  • Now there will be two theme folders under ‘wp-content > themes’.
  • One is of main theme ‘themename’ and other is of child theme ‘themename_child’
  • Make sure you have Activated child theme
 
FTP Uplaod
  • Upload parent (main theme) first
  • Upload ‘themename_child’ folder here : wp-content > themes
  • Now there will be two theme folders under ‘wp-content > themes’.
  • One is of main theme ‘themename’ and other is of child theme ‘themename_child’
  • Make sure you have Activated child theme
 

theme-FTP-install

 
  • Any template file that needs to edit should be copied to your child theme folder at same location. Changes made will overwrite the files of the parent theme.
  • For Example :
    If you need to change styles, write them in your child theme’s style.css.
    If need changes in header, copy header.php to child theme, edit. Changes will overwrite original header.php.
  • Only ‘functions.php’ of a child theme does not override parent theme’s functions.php. Instead, it is loaded in addition and before the parent’s.
  • Google ‘WordPress Child theme’ for more details.
 
WordPress Default behavior in relation to child theme

Please note this is not related to theme 🙂

  • On Activating Child Theme Why I Lost my Customizer Settings? – Read More
  • If widgets added while on child theme
     

    In case you shift to main or any other theme, widgets may go to ‘Inactive Widgets’ section. No need to panic in this case too, as those are present in ‘Inactive Widgets’ section.

     

    When you switch back to child theme widgets can be dragged back.

  • Sometimes when switched to child theme menu disappears. No need to panic, just assign the menu again ( just a single click will bring it back ). Rare case though.