[Resolved] Parent them functions not found.

Home Forums Support Parent them functions not found.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #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.44
    GP Premium 1.2.94
    #279248
    Tom
    Lead Developer
    Lead 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.

    #279253
    William

    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=c5e968a

    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 🙂

    #279255
    Tom
    Lead Developer
    Lead 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.

    #279262
    William

    – 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.

    #279404
    Tom
    Lead Developer
    Lead Developer
Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.