Title: Child theme function.php widget problem
Last modified: February 24, 2018

---

# Child theme function.php widget problem

 *  Resolved [johnbrid](https://wordpress.org/support/users/johnbrid/)
 * (@johnbrid)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/child-theme-function-php-widget-problem/)
 * I am using a child theme with customizr. I am using the enqueue method in function.
   php. There does not seem to be anything wrong with my child themes style.css 
   file. It cheks out with no errors in a Lint validator. If i switch back to the
   customizr theme and put the childs themes style.css contents in the advanced 
   css box everything works fine. When i go back to my child theme, all the style
   changes are fine but the widgets are in the wrong place. The left side bar widget
   goes to the top and the right side widget goes to the bottom. I have even tried
   two different function.php files that i found and bot behvae the same.
 * <?php
    function themeslug_enqueue_style() { if ( is_child_theme() ) { // load
   parent stylesheet first if this is a child theme wp_enqueue_style( ‘parent-stylesheet’,
   trailingslashit( get_template_directory_uri() ) . ‘style.css’, false ); } // 
   load active theme stylesheet in both cases wp_enqueue_style( ‘theme-stylesheet’,
   get_stylesheet_uri(), false ); }
 * add_action( ‘wp_enqueue_scripts’, ‘themeslug_enqueue_style’ );
    ?>
 * _ **and another one**_
 * <?php
    remove_action(‘wp_print_styles’, ‘cc_tabby_css’, 30);
 * function theme_enqueue_styles() {
    wp_enqueue_style( ‘parent-style’, get_template_directory_uri().‘/
   style.css’ );
 * }
    add_action( ‘wp_enqueue_scripts’, ‘theme_enqueue_styles’ );
 * ?>
 * I am amazed at how different they both are but they both execute the style changes
   properly but both move the widgets. Can anybody help.
    Thanks
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fchild-theme-function-php-widget-problem%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  [Rocco Aliberti](https://wordpress.org/support/users/d4z_c0nf/)
 * (@d4z_c0nf)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/child-theme-function-php-widget-problem/#post-10015605)
 * Hi John,
    in CSS the rules loading order makes a lot of difference. When there
   are two (or more) rules with same specificity, the latter will override the previous
   one.
 * Anyway the Customizr theme doesn’t need any additional code in the child-theme
   functions.php, to load the child-theme stylesheet:
    The Customizr theme takes
   care about loading it ensuring the correct order (after the parent theme stylesheet).
 * About your issue with the sidebar:
    I can see from your page that the div with`
   id="content"` misses the `class` attribute value – which is needed to give a 
   certain width to it. [https://github.com/presscustomizr/customizr/blob/v4.0.16/index.php#L24](https://github.com/presscustomizr/customizr/blob/v4.0.16/index.php#L24)
 * So there’s something in your child-theme php part (did you override any php file?)
   that causes that.
 *  Thread Starter [johnbrid](https://wordpress.org/support/users/johnbrid/)
 * (@johnbrid)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/child-theme-function-php-widget-problem/#post-10015757)
 * Thank you so much Rocco. With your help in tracking it down it is now solved.
   I checked all my .php files in the child theme and it was my childs index.php
   causing the problem and I do not even know why it was there as I am sure it is
   not needed. I had copied the customizer theme index.php across to the child theme.
   Maybe by accident with a double click on a directory in Filezilla. With it deleted
   it all works fine. I think unless you have made changes you do not actually need
   the.php files at all for a child theme apart from function.php to do the enqueing.
   Is that right?
 *  [Rocco Aliberti](https://wordpress.org/support/users/d4z_c0nf/)
 * (@d4z_c0nf)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/child-theme-function-php-widget-problem/#post-10016014)
 * Hi john,
    glad you solved.
 * Yes that’s right, even the child-theme functions.php is not strictly needed to
   make a child-theme, but unless your aim is to change only the CSS, you might 
   need it in the future.
 * Best regards.
 * Rocco

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

The topic ‘Child theme function.php widget problem’ is closed to new replies.

 * ![](https://i0.wp.com/themes.svn.wordpress.org/customizr/4.4.24/screenshot.png)
 * Customizr
 * [Support Threads](https://wordpress.org/support/theme/customizr/)
 * [Active Topics](https://wordpress.org/support/theme/customizr/active/)
 * [Unresolved Topics](https://wordpress.org/support/theme/customizr/unresolved/)
 * [Reviews](https://wordpress.org/support/theme/customizr/reviews/)

## Tags

 * [child theme](https://wordpress.org/support/topic-tag/child-theme/)
 * [function.php](https://wordpress.org/support/topic-tag/function-php/)
 * [widget](https://wordpress.org/support/topic-tag/widget/)

 * 3 replies
 * 2 participants
 * Last reply from: [Rocco Aliberti](https://wordpress.org/support/users/d4z_c0nf/)
 * Last activity: [8 years, 3 months ago](https://wordpress.org/support/topic/child-theme-function-php-widget-problem/#post-10016014)
 * Status: resolved