Child Theme issues
-
I created a child theme which seemed to work until I noticed I could no longer choose the page layout templates from a drop-down list as in the parent theme.
After deactivating and reactivating the child theme, I got an error child theme broken reverting to default twenty twelve.
I uninstalling and re-installing the parent theme, reducing the child theme to the bare stlye.css with the @import url(“../mosaic/style.css”);
Still no luck so I then renamed the child theme to child theme old and it now works and the templates are available.
Happy, but intrigued as to what caused the issue and whether it might reappear, I began reading on non child-theme friendly themes and noticed my parent themes seems to qualify.
It uses require once several times.
It defines using get_stylesheet_directory instead of get_template_directory
Several suggestions are given to alleviate the problems and I would like some confirmation on procedures I would like to do to prevent breakage.
Should I add the following files to child directory to ensure my child theme continues working?
1. theme-options.php file containing// Include Theme Options from parent theme directory
<?php
require_once ( get_template_directory() . '/theme-options.php' );
?>
2. shortcodes.php// Include require once file for shortcodes file from parent theme
<?php
require_once( MOSAIC_PARENT_DIR . '/shortcodes.php' );
?>
3. options-framework.php// Include Options Framework from parent theme directory
<?php
require_once( OPTIONS_FRAMEWORK_DIRECTORY . 'options-framework.php' );
?>
4.functions.php/* point to parent template folder for page layouts not stylesheet folder */
<?php
define( 'MOSAIC_CHILD_DIR', get_template_directory() );
?>
Thanks in advance!
- The topic ‘Child Theme issues’ is closed to new replies.