Title: TwentySeventeen-child Theme function.php error
Last modified: March 29, 2017

---

# TwentySeventeen-child Theme function.php error

 *  [tommyqr](https://wordpress.org/support/users/tommyqr/)
 * (@tommyqr)
 * [9 years, 2 months ago](https://wordpress.org/support/topic/twentyseventeen-child-theme-function-php-error/)
 * I copied code for Twentyseventeen-child function.php on how to add a sidebar 
   to page.php.
    I know that the page.php is not causing the error nor any other
   files used in child thembe because I have added them one by one without any coding
   in functions.php except wht is required for enreque.
 * Here is my code found functions.php file
 *     ```
       <?php 
       function childtheme_enqueue_styles() {
       wp_enqueue_style( 'parent-style', 
       get_template_directory_uri() . '/style.css' );
   
       wp_enqueue_style( 'child-style',
       get_stylesheet_directory_uri() . '/style.css',
       array( 'parent-style' ),
       wp_get_theme()->get('Version')
       );
       }
       add_action( 'wp_enqueue_scripts', 'childtheme_enqueue_styles' );
       function twentyseventeen_body_classes_child( $classes ){
       if ( is_active_sidebar( 'sidebar-1' ) &&  is_page() ) {
       		$classes[] = 'has-sidebar';
       	}
       	return $classes;
       }
       add_filter( 'body_class', 'twentyseventeen_body_classes_child' );
       ?>	 
       ```
   
 * I have been trying for a while and do not know what I am doing wrong.
    Help from
   someone would be very much appreciated.
 * I like TwentySeventeen. It is really cool to use. I just want to be able to add
   sidebars to page. But I get a 302 error when activating the child theme which
   is caused by the functions.php file. I do not understand why.
 * Thanks for much for some direction.

Viewing 1 replies (of 1 total)

 *  [killq](https://wordpress.org/support/users/killq/)
 * (@killq)
 * [9 years, 2 months ago](https://wordpress.org/support/topic/twentyseventeen-child-theme-function-php-error/#post-8975523)
 * Try this for a simple fix…the plugin ‘Advanced Twenty Seventeen’ comes with a
   built in child theme. All you need to do is install/activate the plugin then 
   go to your theme menu and change your active theme to the child.

Viewing 1 replies (of 1 total)

The topic ‘TwentySeventeen-child Theme function.php error’ is closed to new replies.

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

 * 1 reply
 * 2 participants
 * Last reply from: [killq](https://wordpress.org/support/users/killq/)
 * Last activity: [9 years, 2 months ago](https://wordpress.org/support/topic/twentyseventeen-child-theme-function-php-error/#post-8975523)
 * Status: not resolved