inc folder in child theme
-
I have made a child theme to modify the Casper theme, I need to override some code in ‘functions.php’ so it points to the correct file inside the child theme ‘inc’ subfolder.
The solution seems be simple: to copy ‘functions.php’ from the parent folder to the child so the references to the ‘inc’ folder will be read as from the child folder. There is not even need to modify functions.php.
When I do this I get the following error in WP:
Fatal error: Cannot redeclare casper_widgets_init() (previously declared in [wp’s absolute path]/wp-content/themes/casper-child/functions.php:76) in [wp’s absolute path]/wp-content/themes/casper/functions.php on line 83
It’s like WP is now executing both ‘functions.php’: the parent and the child, this causes the ‘redeclaration’ mentioned in the error message.
I like the idea of having a child theme but this is confusing. How should I do it?
Thanks
The topic ‘inc folder in child theme’ is closed to new replies.