• 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)
  • 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.