Customize widget

Hi there,

I’d like to customize the contact info widget in my child theme. I followed the instructions for the similar question here but it is not working: the contact info is still being drawn from contact-info.php in the parent theme, not the child theme.

Here’s what the top of [child theme]/widgets/contact-info.php looks like:
<?php

class Sydney_Child_Contact_Info extends WP_Widget {

public function __construct() {

    $widget_ops = array('classname' => 'sydney_contact_info_widget', 'description' => __( 'Display your contact info', 'sydney') );

    parent::__construct(false, $name = __('Sydney: Contact info (child)', 'sydney'), $widget_ops);

    $this->alt_option_name = 'sydney_contact_info';

Here’s what my functions.php looks like:

 * Requiring latest contact widget file from childtheme
 */
require get_stylesheet_directory() . '/widgets/contact-info.php';

// // /*
// //  * Registering new contact info widget
// //  */
function sydney_child_register_new_contact_widget(){

register_widget( 'Sydney_Child_Contact_Info' ); // Widget class name
 }
  add_action( 'widgets_init', 'sydney_child_register_new_contact_widget' );

I can see that it is pulling the new php file into the page, but the actual content in the footer is still from the parent theme. Thanks in advance for the help!

Hi,

The new widget won’t replace the active one. So you should remove the current one from widgets (Appearance > Widgets) and insert your “Sydney: Contact info (child)

Regards,
Kharis
aThemes Support