[Resolved] Fatal Error in header.php

Home Forums Support [Resolved] Fatal Error in header.php

Home Forums Support Fatal Error in header.php

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #466132
    Stewart

    I’m getting this error when trying to load my site:

    Fatal error: Call to undefined function generate_body_schema() in /public_html/site_directory/wp-content/themes/generatepress/header.php on line 21

    This is the second time it has happened. The last time I didn’t touch the website, just checked on it and saw this error. Restored it last night from a backup, everything was all good for a few hours, went to bed and woke up to the error again.

    This is the header file, I’m not great with PHP, but nothing looks off to me. Any help would be supe appreciated!

    <?php
    /**
     * The template for displaying the header.
     *
     * @package GeneratePress
     */
    
    if ( ! defined( 'ABSPATH' ) ) {
    	exit; // Exit if accessed directly.
    }
    
    ?><!DOCTYPE html>
    <html <?php language_attributes(); ?>>
    <head>
    	<meta charset="<?php bloginfo( 'charset' ); ?>">
    	<meta http-equiv="X-UA-Compatible" content="IE=edge" />
    	<link rel="profile" href="http://gmpg.org/xfn/11">
    	<?php wp_head(); ?>
    </head>
    
    <body <?php generate_body_schema();?> <?php body_class(); ?>>
    	<?php
    	/**
    	 * generate_before_header hook.
    	 *
    	 * @since 0.1
    	 *
    	 * @hooked generate_do_skip_to_content_link - 2
    	 * @hooked generate_top_bar - 5
    	 * @hooked generate_add_navigation_before_header - 5
    	 */
    	do_action( 'generate_before_header' );
    
    	/**
    	 * generate_header hook.
    	 *
    	 * @since 1.3.42
    	 *
    	 * @hooked generate_construct_header - 10
    	 */
    	do_action( 'generate_header' );
    
    	/**
    	 * generate_after_header hook.
    	 *
    	 * @since 0.1
    	 *
    	 * @hooked generate_featured_page_header - 10
    	 */
    	do_action( 'generate_after_header' );
    	?>
    
    	<div id="page" class="hfeed site grid-container container grid-parent">
    		<div id="content" class="site-content">
    			<?php
    			/**
    			 * generate_inside_container hook.
    			 *
    			 * @since 0.1
    			 */
    			do_action( 'generate_inside_container' );
    
    #466264
    Leo
    Staff
    Customer Support

    Hi there,

    Have you modified the theme’s core file at all?

    Can you try re-installing GeneratePress? https://generatepress.com/install-generatepress/

    #466320
    Stewart

    Hi Leo,

    Haven’t touched the theme at all, I’m using a child theme.

    I reinstalled the Generatepress and it’s back up and running, don’t know why I didn’t try that first. Ha! Thanks for the help!

    I’ll monitor it over the next 12 hours and see if it reverts like it did last time.

    #466344
    Leo
    Staff
    Customer Support

    Sounds good 🙂

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.