- This topic has 5 replies, 2 voices, and was last updated 4 years ago by
Tom.
-
AuthorPosts
-
February 15, 2017 at 11:15 am #279243
William
Greetings,
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
<head>
;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 #279248Tom
Lead DeveloperLead DeveloperThey 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.
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentFebruary 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 :
http://www.tiikoni.com/tis/view/?id=c5e968aError 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 #279255Tom
Lead DeveloperLead DeveloperJust 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.
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentFebruary 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
define('WP_DEBUG', true);
This fixed the issue. Mysterious π
Thanks for your support.February 15, 2017 at 6:33 pm #279404Tom
Lead DeveloperLead DeveloperGlad you got it working π
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-development -
AuthorPosts
- You must be logged in to reply to this topic.