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.

 

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


Content, images you have added in pages, posts, WP Customizer settings, Theme Options settings, general WordPress settings etc. do not get affected by theme update.

 
  • 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.
 
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 which you need to modify…copy and paste at the same location / hierarchy in the child theme. Make changes in this file. This will overwrite main theme file.
  • 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.