Child Theme Support

The IonMag theme has child theme support integrated. So, using the child theme, you can overwrite code or CSS for particular templates, modules, blocks, etc.

The child theme support included in our themes is intended for developers to modify core parts of the theme without changing the actual theme. This allows you to keep updating the theme without losing your changes.

A sample child theme can be downloaded from here

What can be overwritten by the child theme:

In the next section, you can find how to use the child theme to overwrite parts of the template. From the beginning, we tested each release to make sure the versions are always compatible with existing modifications.

1. Single Templates

In the ionMag theme, the single templates are located in the theme root path. Copy the single template file you need, to the child theme, into its root path, and then customize it as you wish. The theme will use the modified template for a post instead of the theme file.

For example, single_template_1.php is copied to the child theme root path:

  1. The theme directory
  2. The child theme directory
  3. The single_template_1.php copied from the theme root directory path to the child theme directory path.

child_theme_single

2. Smart Lists

The smart lists files are in the …/theme_name/includes/smart_lists/ directory. Create the same directory structure under your child theme root path (…/child_theme_name/includes/smart_lists/), copy the smart list file you need into the structure you created in the child theme.

Let’s see how we can overwrite smart list 1 template from child theme.

  1. Go to the theme root path
  2. You have to find td_smart_list_1.php in the theme path
  3. Choose the td_smart_list_1.php from the smart_lists directory

As example, the smart_list_1.php is copied:

child_theme_smart_list

 

Now, having the td_smart_list_1.php identified, you have to:

  1. Go to the child theme root
  2. Create a directory structure path in the child theme as in the main theme
  3. Paste the td_smart_list_1.php file and that’s it.

child_theme_smart_list_1

3. Modules

The modules files are in the …/theme_name/includes/modules/ directory. The modules are the elements for showing the post content, and they are used inside of the WordPress templates (achive, author, category, etc) and/or as block components. Each block is a container for some of these modules.

You have to see what module you need to be overwritten by the child theme, and copy it the the child theme under a similar folder structure (…/child_theme_name/includes/modules/).

You have to consider that changing a module used by multiple block and templates, will be implemented globally, in all those structures.

Let’s see how we can overwrite module 1 from the child theme.

  1. Go to the theme root path
  2. You have to find td_module_1.php in the theme path
  3. Copy the td_module_1.php from the modules directory

child_theme_module_1

 

Once you have identified the td_module_1.php , you have to:

  1. Go to the child theme root
  2. Create a directory structure path in the child theme as in the theme
  3. Paste the td_module_1.php file and that’s it.

child_theme_module_1_2

 

4. Headers

The headers are in the …/theme_name/parts/header/ directory. Create the same directory structure under your child theme root path (…/child_theme_name/parts/header/), copy there the header file you need to modify and it’s ready to be used.

Let’s see what happens when you want to overwrite the header style 1 from child theme:

  1. Go to the theme root path
  2. You have to localize the header-style-1.php in the theme path
  3. Choose the header-style-1.php from the header directory

child_theme_header_style_1

 

Now, all you have to do is:

  1. Go to the child theme root
  2. Create a directory structure path in the child theme as in the theme
  3. Copy the header-style-1.php file and here you go.

child_theme_header_style_1_child

 

5. Blocks

Mainly, the blocks are used as modules’ containers. They are located in the …/theme_name/includes/shortcodes/ directory.

There you can choose what block files you need to modify by the child theme, and copy them to the child theme, into the same directory structure (…/child_theme_name/includes/shortcodes/). Inside of one block file you’re able to see what modules are used (td_module_).

For example, for overwriting block 1 from the child theme:

  1. Go to the theme root path
  2. You have to localize the td_block_1.php in the theme path
  3. Choose the td_block_1.php from the shortcodes directory

child_theme_blocks

 

Having the td_block_1.php, you just have to copy it to the child theme, so:

  1. Go to the child theme root
  2. Create a directory structure path in the child theme as in the theme
  3. Copy there the td_block_1.php file and that’s all, it’s ready to modify.

child_theme_block_1

6. Block template

The block templates are in the …/theme_name/includes/block_templates/ directory. As of now, we have just one block template, but it’s set as the others components of the theme for the flexibility in adding new features.

If you want to modify a block template, make the same directory structure path in the child theme (…/child_theme_name/includes/block_templates/) and copy the block template there. The blocks that are using the block template, knows to load your child theme block template now.

Let’s see what happens when you want to overwrite the only block template, from child theme:

  1. Go to the theme root path
  2. You have to localize the td_block_template_1.php in the theme path
  3. Choose the td_block_template_1.php from the block_templates directory

child_theme_block_templates

 

Now, all you have to do is copying it to the child theme, so:

  1. Go to the child theme root
  2. Create a directory structure path in the child theme as in the theme
  3. Copy there the td_block_template_1.php file and there you are.

child_theme_block_templates_1

7. Category templates

The category templates are in the …/theme_name/includes/category_templates/ directory. Make the same child theme directory structure (…/child_theme_name/includes/category_templates/) and copy there the category template you want to modify.

For example, let’s modify the category template 1, from the child theme:

  1. Go to the theme root path
  2. You have to localize the td_category_template_1.php in the theme path
  3. Choose the td_category_template_1.php from the category_templates directory

child_theme_category_template

 

The td_category_template_1.php has to be copied to the child theme, so:

  1. Go to the child theme root
  2. Create a directory structure path in the child theme as in the theme
  3. Copy there the td_category_template_1.php file and there you are, the file is ready to be modified

child_theme_category_template1

 

8. Category top post style

The category top post style templates are in the …/theme_name/category_top_posts_styles/ directory. As you should know, you have to make the same directory structure (…/theme_name/category_top_posts_styles/) in the child theme, and copy there the template you need to modify. The child template will be load for the category top post style you have chosen.

The following steps you can follow to modify ‘category top post style 1’, from the child theme:

  1. Go to the theme root path
  2. You have to localize the td_category_top_posts_style_1.php in the theme path
  3. Choose the td_category_top_posts_style_1.php from the category_top_posts_styles directory

child_theme_top_posts_style

 

Now, all you have to do is just to copy it to the child theme, so:

  1. Go to the child theme root
  2. Create a directory structure path in the child theme as in the theme
  3. Copy there the td_category_top_posts_style_1.php file and that’s it.

child_theme_top_posts_style1

 

9. Footer template

The footer templates are in the …/theme_name/parts/footer/ directory. Make the same directory structure in the child theme (…/child_theme_name/parts/footer/) and copy there the footer template you need to modify.

For example, using the child theme for modifying the footer template 1, all you have to do is:

  1. Go to the theme root path
  2. You have to localize the td_footer_template_1.php in the theme path
  3. Choose the td_footer_template_1.php from the footer directory

child_theme_footer_templates

 

Now copy the td_footer_template_1.php to the child theme, so:

  1. Go to the child theme root
  2. Create a directory structure path in the child theme as in the theme
  3. Copy there the td_footer_template_1.php file. That’s it!

child_theme_footer_template_1

 

10. Comments

Usually the WordPress templates should be easily modified by copying them into the child theme. The comments file can also be modified using the child theme. You just need to copy the comments.php file from the booster theme directory path (…/theme_name/includes/wp_booster/comments.php), to the root child theme path.

comments

 

Important! Do not copy the root theme comments.php to the child theme path.

comments_root

 

Inside of it, you should read the same info.

comments_root_file

 

11. Other specific theme files that can be modified using child theme, are the following from wp_booster theme directory:

  1. td_css_inline.php
  2. td_login.php
  3. td_category_template.php
  4. td_category_top_posts_style.php
  5. td_page_generator.php
  6. td_block_layout.php
  7. td_template_layout.php
  8. td_css_compiler.php
  9. td_module_single_base.php
  10. td_smart_list.php

For these files you just have to create a folder structure path in the child theme like the one existing in the main theme (…/child_theme_name/includes/wp_booster/ directory), and copy there the files you need to modify.

12. The WordPress templates which are not loaded by the theme API, like archives.php, header.php, etc, have child theme standard support.