Site logo

Archived topic

Fatal Error when updating GeneratePress to the new version

15 replies · Started by Huy on November 19, 2018

Viewing posts 1–15 of 16

Today I've just updated Generatepress theme to the new version and my website totally went down and it showed up this

Fatal error: require(): Failed opening required '/home/brobbqco/public_html/wp-content/themes/generatepress/inc/element-classes.php' (include_path='.:/usr/local/lsws/lsphp70/share/pear:/usr/local/lsws/lsphp70/share/php:/usr/share/pear:/usr/share/php') in /home/brobbqco/public_html/wp-content/themes/generatepress/functions.php on line 73

Can you help me please

Hi there,

element-classes.php no longer exists, but the theme doesn't make a call to that file anymore.

Are you using a child theme? If so, make sure the functions.php file only has your custom functions in it, not anything from the parent theme.

If you're not using a child theme, your functions.php file in the parent theme didn't update for some reason. You'll want to remove the theme folder via your File Manager and upload a fresh version.

Hi Tom

I am using a child theme, but I downloaded it officially from generate press. I didn't create it my self

So what should I do now?

Thank you

In that case, the parent theme didn't complete the update somehow. Maybe your server was interrupted?

You'll want to replace the wp-content/themes/generatepress folder with a fresh version via FTP or File Manager inside your hosting.

You mean that I should replace the installation folder of Generate press by the new one??

Does this make all my setting and other customizations disapear?

Yes, you have incorrect files. That error is saying line 73 is calling on element-classes.php, but it should be customizer.php: https://github.com/tomusborne/generatepress/blob/2.2/functions.php#L73

You can open the functions.php file to check if it's making reference to element-classes.php. I'd be curious to know if it is or not.

No, replacing the files won't lose any of your customizations (WordPress replaces the files during an update in the Dashboard).

Hi Tom

At the moment I rolled back the website to the latest version of yesterday so now the site works normally

But a few moments ago, When I checked the 73 line, it didn't call the element-classes.php file as you said. I searched all the file and that file was not called in the functions.php file

So something on your site is calling for that file. What are the contents of your child theme functions.php file?

This is the content from child theme's functions file

<?php
/**
 * GeneratePress child theme functions and definitions.
 *
 * Add your custom PHP in this file. 
 * Only edit this file if you have direct access to it on your server (to fix errors if they happen).
 */

function generatepress_child_enqueue_scripts() {
	if ( is_rtl() ) {
		wp_enqueue_style( 'generatepress-rtl', trailingslashit( get_template_directory_uri() ) . 'rtl.css' );
	}
}
add_action( 'wp_enqueue_scripts', 'generatepress_child_enqueue_scripts', 100 );

Is there any incorrect code?

Nope, that's fine.

Maybe you have aggressive caching that was continuing to call that file even though the updated file doesn't call on it anymore?

If you looked in functions.php while the site was broken and that file wasn't referenced, then that would be the only explanation I'd think.

Would you mind to check my site from back end? because I am using a child theme, I have a little or no knowledge about coding and I really really want to fix this issue

I dont want to encounter this error anymore when next time I update the theme or GP premium plugin

Thank you

Hey Tom

I've submitted the information via that link in the account issue

I hope we can find the problem before the morning T..T

Thank you so much much

I just did the update and everything seems to be fine.

Perhaps something interrupted the process when you did it?

Let me know if you see anything wrong :)

Thank you so much Tom

Everything looks so good at the moment

I hope it will continue being like that

And thank you so much for your support, even in the midnight!

Thank you so much (Again)

This archived topic is closed to new replies.