Child Theme – Using functions.php to override template php files
-
Wrapping my head around child themes.
I get that a template in a child theme will overwrite a template in the parent theme.
Ex:child/header.php
will overwriteparent/header.php
I want to add a function (my-function) to
header.php
. It seems a waste to duplicate the entireheader.php
file to the child from the parent.I’ve read many threads that say the
functions.php
file in the child theme can amend functions in the parent theme.Is it possible to add (my-function) to
functions.php
in the child theme, and have it added toheader.php
of the parent theme?
Ex:child/functions.php(my-function)
is amended toparent/header.php
Thanks
- The topic ‘Child Theme – Using functions.php to override template php files’ is closed to new replies.