How to update PHP code in a child theme
-
Hi
I am trying to update some PHP code in my child theme, but am having problems.
Depending on which Google search result I look at I seem to get conflicting advice. Some say just copy the PHP from the parent to the child, make the changes and it will work. I have tried this putting the PHP files in the root directory of the child theme, and also replicating the parent theme structure by putting them in a “inc” sub directory. Neither seemed to be read when I made some changes.
I also got some results that said I needed to add a ‘require_once( get_stylesheet_directory() . ‘/xxx.php’ );’ statement to my child theme function.php, but when I do I always get an error when saving the file:
Fatal error: Cannot redeclare accelerate_customize_register() (previously declared in /var/sites/o/onefishermansloft.co.uk/public_html/wp-content/themes/accelerate-child/customizer.php:10) in /var/sites/o/onefishermansloft.co.uk/public_html/wp-content/themes/accelerate/inc/customizer.php on line 630
I am not a coder or php guru so at this point I am a bit stuck.
Can anyone help?
Thanks
Ian
- The topic ‘How to update PHP code in a child theme’ is closed to new replies.