- This topic has 5 replies, 2 voices, and was last updated 4 years ago by Tom.
February 15, 2017 at 11:15 am #279243William
I have created a child theme to integrate some content within the parent theme files. I copied the header.php file from parent theme to child and added the Facebook tags within the
Unfortunately I get the following error when activating the child theme :
[15-Feb-2017 19:06:59 UTC] PHP Fatal error: Call to undefined function generate_body_schema() in /home/wlarchev/public_html/apartamentocovenas.co/wp-content/themes/generatepress-child/header.php on line 39
Why can’t the parent theme functions be used in the child theme ?
Thanks,GeneratePress 1.3.44GP Premium 1.2.94February 15, 2017 at 11:17 am #279248TomLead DeveloperLead Developer
They can. Have you verified that the function exists in the parent theme? Using the latest version?
Also, if you’re only adding things like facebook tags, you’re way better off inserting them into GP Hooks instead of creating a child theme and overwriting the entire header.php file.February 15, 2017 at 11:26 am #279253William
Thanks Tom for your quick reply. In header.php, I am only adding the Facebook Pixel. I know I can use the hooks, but this will not resolve my issue.
I am using the latest Generate Press Version: 1.3.44.
Here is a comparison of both header.php files :
Error is :
[15-Feb-2017 19:24:01 UTC] PHP Fatal error: Call to undefined function generate_body_schema() in /home/wlarchev/public_html/apartamentocovenas.co/wp-content/themes/generatepress-child/header.php on line 35
The parent theme function
generate_body_schema()cannot be called in the child theme… I do not understand why as I am using GeneratePress in another site without any problem.
Please advise 🙂February 15, 2017 at 11:30 am #279255TomLead DeveloperLead Developer
Just tried it myself with a child theme – no issues.
Can you try with the blank child theme available here?: https://docs.generatepress.com/article/using-child-theme/
As for your code, that should definitely go into the wp_head hook in GP Hooks. That way you won’t miss out on any changes I make the header.php file in the future.February 15, 2017 at 11:45 am #279262William
– I just removed all the files I had in the “generatepress-child” theme folder and replaced with the blank child theme provided in your documentation.
– I deactivated all plugins.
– I forced a reinstall of the parent theme to latest version.
– I disabled any server-side caching.
– I set
This fixed the issue. Mysterious 🙂
Thanks for your support.February 15, 2017 at 6:33 pm #279404
- You must be logged in to reply to this topic.