I’m using:
espresso_get_template_part( ‘content’, ‘espresso_events-details’ );
in my child theme and after updating to EE4.9 my site stopped working providing the following error in the log.
I quickly reverted to the previous 4.8.43 and it’s working normally again
Hi,
yes here it is.
2016/06/24 16:04:23 [error] 29664#0: *273134 FastCGI sent in stderr: “PHP message: PHP Fatal error: Uncaught Error: Call to undefined function espresso_get_template_part() in /wp-content/themes/x-child/single-reis.php:82
line 82 in single-reis.php reads:
espresso_get_template_part( ‘content’, ‘espresso_events-details’ );
This reply was modified 8 years, 6 months ago by Tony. Reason: Remover server path
It was quite likely that you didn’t get a fatal error with the older version of Event Espresso. You can wrap your code in a check for the function to avoid fatal errors. Here’s an example:
No functions were removed, but if your template is loading on a non – Event Espresso route it could throw a fatal error because Event Espresso doesn’t load everything all the time.
Ok, how to make sure EE is loaded then in this case (CPT which includes theEE event).
Also can you give any suggestion as to why it always worked without errors or even warnings. Nothing has changed on the site.
It was likely that before Event Espresso shouldn’t have been loading everything on a non-CPT route, then that bug was fixed. So your code worked only because of a happy accident.
Viewing 7 reply threads
The support post ‘EE4.9 PHP fatal error on espresso_get_template_part’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.
Support forum for Event Espresso 3 and Event Espresso 4.