I did. I now realize you can’t do that. The child theme’s functions.php should only contain new functions.
But I have a problem then. I am using the functions.php to create an additional sidebar. I just deleted everything in the functions.php except for this function. But I still get a similar error.
Here is the code in my child theme’s functions.php:
<?php
if ( ! function_exists( 'twentythirteen_widgets_init' ) ) {
function twentythirteen_widgets_init() {
register_sidebar( array(
'name' => __( 'Main Widget Area', 'twentythirteen' ),
'id' => 'sidebar-1',
'description' => __( 'Appears in the footer section of the site.', 'twentythirteen' ),
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>',
) );
register_sidebar( array(
'name' => __( 'Secondary Widget Area', 'twentythirteen' ),
'id' => 'sidebar-2',
'description' => __( 'Appears on posts and pages in the sidebar.', 'twentythirteen' ),
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>',
) );
register_sidebar( array(
'name' => __( 'Third Widget Area', 'twentythirteen' ),
'id' => 'sidebar-3',
'description' => __( 'Is only for the front page.', 'twentythirteen' ),
'before_widget' => '<aside id="%1$s" class="widget widget-fp1">',
'after_widget' => '</aside>',
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>',
) );
}
}
?>
As you can see I just added a third sidebar. However I now get this fatal error message:
Fatal error: Cannot redeclare twentythirteen_widgets_init() (previously declared in /home/content/20/11764620/html/wordpress/wp-content/themes/twentythirteen-child/functions.php:7) in /home/content/20/11764620/html/wordpress/wp-content/themes/twentythirteen/functions.php on line 245