Redeclare a function in a child theme

Redeclaring a function in a child theme only works when the parent themes’ function is wrapped in a

 if( !function_exists( 'function_name' )):

condition. Then you can simply just copy the complete function to the child theme and do whatever modifications you need to do.

If the parent themes’ functions aren’t wrapped in that if conditional statement, and if no filters or hooks are supplied in the function, it will be best to copy the function to your child theme, rename that function, do your modifications and then update your template files accordingly to reflect the new function.

Leave a Comment