badget

Biggest Sale! Special Offer!

Get 30% discount on all of our single themes with this coupon code: #30%SALE

Hurry up! *Limited time offer*

Reply To: Trying to add a phone number to the header area

#4401
Sanjip Shah
Participant

@chavalu To learn about how the functions of parent theme are unhooked from an action hook and how a function from child theme is added to action hook you can visit this link http://themeshaper.com/2009/05/25/action-hooks-wordpress-child-themes/. Below is an example of how its done. Put this code in the functions.php file of the child theme inside a php tag ( <?php code here ?> )

add_action( ‘init’, ‘attitude_remove_parent_function’ );
/**
* Removes parent function attached to hook
*/
function attitude_remove_parent_function(){
remove_action( ‘attitude_header’, ‘attitude_headerdetails’, 10 );
}

add_action( ‘attitude_header’, ‘attitude_child_headerdetails’, 10 );
/**
* Add your custom function
*/
function attitude_child_headerdetails() {
// Copy all the content inside the attitude_headerdetails function of parent theme, paste here and make necessary changes here.
}