Adding new functions with enqueued child theme
-
Hi
I’m not vastly-experienced in php, but I have built child themes for heavily-customised sites previously using the previous ‘import’ method, and that worked fine. When I needed to add extra functions, etc, I just copied the appropriate .php file to the child theme and amended that – no problems.
I am now building a new site for the first time using the newer ‘enqueueing’ methodology, where the child has its own functions.php. Everything’s fine, other than I need to register a new function – a header widget.
I tried copying the main function.php across instead of the new one, but that didn’t work. So I have tried adding the new function to the child theme’s new functions.php instead, but I couldn’t get that to work either.
The only way I can see to make it work is to modify the main theme’s functions.php, which sort-of torpedoes the whole reason for having a child them in the first place!
Any suggestions?
The topic ‘Adding new functions with enqueued child theme’ is closed to new replies.