October 4, 2013 at 7:42 am
#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.
}