Title: Child theme and function.php function override
Last modified: August 22, 2016

---

# Child theme and function.php function override

 *  Resolved [Raul Fernandez](https://wordpress.org/support/users/liken22/)
 * (@liken22)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/child-theme-and-functionphp-function-override/)
 * Hello everyone.
 * What I would like to know is how can I override a function by adding a function.
   php file in my child theme. For example, I would like to add a new widget and
   I want to add a new option there like this:
 *     ```
       register_sidebar( array(
       		'name'          => __( 'Header Contact', 'moesia' ),
       		'id'            => 'header-1',
       		'description'   => '',
       		'before_widget' => '<aside id="%1$s" class="widget %2$s">',
       		'after_widget'  => '</aside>',
       		'before_title'  => '<span class="contact-title">',
       		'after_title'   => '</span>',
       	) );
       ```
   
 * I would really appreciate your help and thank you in advance.
 * Raul

Viewing 1 replies (of 1 total)

 *  [vladff](https://wordpress.org/support/users/vladff/)
 * (@vladff)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/child-theme-and-functionphp-function-override/#post-5436222)
 * Hello,
 * You don’t need to overwrite it, you just need to add a new function in your child
   theme’s functions.php file:
 *     ```
       function raul_widgets_init() {
          ........
       }
       add_action( 'widgets_init', 'raul_widgets_init' );
       ```
   

Viewing 1 replies (of 1 total)

The topic ‘Child theme and function.php function override’ is closed to new replies.

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

 * 1 reply
 * 2 participants
 * Last reply from: [vladff](https://wordpress.org/support/users/vladff/)
 * Last activity: [11 years, 7 months ago](https://wordpress.org/support/topic/child-theme-and-functionphp-function-override/#post-5436222)
 * Status: resolved