Home › Forums › Support › Allow overrides for functions › Reply To: Allow overrides for functions
November 6, 2016 at 11:12 am
#242173
Tom
Lead Developer
Lead Developer
Hi there,
It’s typically not a good idea to overwrite files that include functions.
For example, I might add a function into that file in the future, then call the function somewhere else in the theme. If that function doesn’t exist because the file is overwritten, you’ll get a fatal PHP error.
Instead, all of the functions in there are wrapped in the function_exists()
function.
That means you can copy the entire function (including the ! function_exists()
part), and paste it into your child theme functions.php.
Then you can make changes to the function.
Hope this helps 🙂