Title: Error when creating child theme
Last modified: August 31, 2016

---

# Error when creating child theme

 *  Resolved [T0M75](https://wordpress.org/support/users/t0m75/)
 * (@t0m75)
 * [10 years ago](https://wordpress.org/support/topic/error-when-creating-child-theme/)
 * I am trying to create child theme whit “Child Theme Configurator” but getting
   error from analysing the parent theme:
    **Notice: Only variables should be passed
   by reference ** I am hoping that may be plugin developer can answer my questions
   or some one else can enlighten me by answering them: Is there any reason why 
   variables should be passed by reference? What are the considerations to insist
   it?
 * [https://wordpress.org/plugins/child-theme-configurator/](https://wordpress.org/plugins/child-theme-configurator/)

Viewing 7 replies - 1 through 7 (of 7 total)

 *  Plugin Author [lilaeamedia](https://wordpress.org/support/users/lilaeamedia/)
 * (@lilaeamedia)
 * [10 years ago](https://wordpress.org/support/topic/error-when-creating-child-theme/#post-7408278)
 * The Analyzer loads the theme preview in debug mode, so any errors can be displayed.
 * Please post the entire error message, especially the file and line number, so
   that you can better determine the source of the error.
 * I may be able to help you find the source of the error, but this would be a question
   for the developer of the theme you are analyzing.
 *  Thread Starter [T0M75](https://wordpress.org/support/users/t0m75/)
 * (@t0m75)
 * [10 years ago](https://wordpress.org/support/topic/error-when-creating-child-theme/#post-7408282)
 * My questions are:
    Is there any reason why variables should be passed by reference?
   What are the considerations to insist it?
 * I do not want to find the source of error i know where it is. I want to know,
   if there is any good reason why the developer of current plugin might make such
   assumption? Is there any security considerations involved or might it cause other
   future errors?
 * The theme i am using is Hueman and the developer has instructions how to create
   child theme, but why can’t I use Child Theme Configurator. I am interested of
   reasons behind the problem nothing else in fear of future. When i choose to use
   named theme.
 * Full error message:
    Notice: Only variables should be passed by reference in 
   hueman/option-tree/ot-loader.php on line 98 Notice: Only variables should be 
   passed by reference in hueman/option-tree/ot-loader.php on line 326
 *  Plugin Author [lilaeamedia](https://wordpress.org/support/users/lilaeamedia/)
 * (@lilaeamedia)
 * [10 years ago](https://wordpress.org/support/topic/error-when-creating-child-theme/#post-7408295)
 * The error is not saying that variables should be passed by reference, it is saying
   that _only_ variables should be passed by reference.
 * For questions like these it is always a good idea to check the PHP documentation:
   [http://php.net/manual/en/language.references.pass.php](http://php.net/manual/en/language.references.pass.php)
 * In this case it is probably a developer not checking his or her code with a debugger.
   This error sometimes occurs when a core function, such as empty(), is given an
   expression as an argument instead of a variable.
 * Hope this helps.
 *  Plugin Author [lilaeamedia](https://wordpress.org/support/users/lilaeamedia/)
 * (@lilaeamedia)
 * [10 years ago](https://wordpress.org/support/topic/error-when-creating-child-theme/#post-7408306)
 * I just checked the php source for the Hueman theme and as I guessed, an expression
   is being passed to a core function (in this case, explode()).
 * Instead of resolving the issue, the developer has decided to silence the notice
   by using the @ modifier. See below:
 * ot-loader.php at line 91:
 *     ```
       if ( apply_filters( 'ot_child_theme_mode', false ) == true ) {
   
                 $path = ltrim( end( @explode( get_stylesheet(), str_replace( '\\', '/', dirname( __FILE__ ) ) ) ), '/' );
                 define( 'OT_LANG_DIR', trailingslashit( trailingslashit( get_stylesheet_directory() ) . $path ) . trailingslashit( 'languages' ) . 'theme-mode' );
   
               } else {
   
                 $path = ltrim( end( @explode( get_template(), str_replace( '\\', '/', dirname( __FILE__ ) ) ) ), '/' );
                 define( 'OT_LANG_DIR', trailingslashit( trailingslashit( get_template_directory() ) . $path ) . trailingslashit( 'languages' ) . 'theme-mode' );
   
               }
       ```
   
 * … and again at line 321:
 *     ```
       if ( true == OT_CHILD_THEME_MODE ) {
                 $path = ltrim( end( @explode( get_stylesheet(), str_replace( '\\', '/', dirname( __FILE__ ) ) ) ), '/' );
                 define( 'OT_DIR', trailingslashit( trailingslashit( get_stylesheet_directory() ) . $path ) );
                 define( 'OT_URL', trailingslashit( trailingslashit( get_stylesheet_directory_uri() ) . $path ) );
               } else {
                 $path = ltrim( end( @explode( get_template(), str_replace( '\\', '/', dirname( __FILE__ ) ) ) ), '/' );
                 define( 'OT_DIR', trailingslashit( trailingslashit( get_template_directory() ) . $path ) );
                 define( 'OT_URL', trailingslashit( trailingslashit( get_template_directory_uri() ) . $path ) );
               }
       ```
   
 *  Thread Starter [T0M75](https://wordpress.org/support/users/t0m75/)
 * (@t0m75)
 * [10 years ago](https://wordpress.org/support/topic/error-when-creating-child-theme/#post-7408311)
 * Thanks a lot! Can you guess if there might be any drawbacks by doing so?
 *  Plugin Author [lilaeamedia](https://wordpress.org/support/users/lilaeamedia/)
 * (@lilaeamedia)
 * [10 years ago](https://wordpress.org/support/topic/error-when-creating-child-theme/#post-7408312)
 * One of the goals of CTC is to help users vet themes prior to using them. The 
   errors and notices come from PHP, not the plugin. They are provided via the analyzer
   for information to identify issues that might crash a site before the theme is
   activated.
 * WordPress.org requires themes and plugins that are hosted ont he repository to
   be free of PHP errors and notices prior to publishing. However, changes in the
   WordPress core or PHP version sometimes cause code to develop issues where they
   had not existed before.
 *  [Juniper](https://wordpress.org/support/users/juniper-webcraft/)
 * (@juniper-webcraft)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/error-when-creating-child-theme/#post-8239452)
 * In my production site, these notices disappeared when I upgraded to Hueman 3.2.8.
 * I’m using PHP 7.0.6, WordPress 4.6.1, and a child theme of my own design.

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Error when creating child theme’ is closed to new replies.

 * ![](https://ps.w.org/child-theme-configurator/assets/icon-128x128.png?rev=1557885)
 * [Child Theme Configurator](https://wordpress.org/plugins/child-theme-configurator/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/child-theme-configurator/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/child-theme-configurator/)
 * [Active Topics](https://wordpress.org/support/plugin/child-theme-configurator/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/child-theme-configurator/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/child-theme-configurator/reviews/)

 * 7 replies
 * 3 participants
 * Last reply from: [Juniper](https://wordpress.org/support/users/juniper-webcraft/)
 * Last activity: [9 years, 8 months ago](https://wordpress.org/support/topic/error-when-creating-child-theme/#post-8239452)
 * Status: resolved