Posted: November 10, 2015 at 3:42 pm
|
Hello, When I put the [ESPRESSO_EVENTS] shortcode on one of my site’s pages it stops the page from completely loading and doesn’t show any events. See the following for an example. This page has nothing but [ESPRESSO_EVENTS] on it. I am using the Avada theme and have a child them installed. Everything else seems to work well. Any help appreciated. |
Hi, I’m interesting in hearing more about this:
Could you try adding a couple words before and after the shortcode like this? Test [ESPRESSO_EVENTS] Test The reason why I ask is I see that your events calendar page which uses an Event Espresso shortcode works just fine. — |
|
|
OK, I added the line above and below the shortcode and as you can see the first line prints then the shortcode crashes the page. You are correct, the shorcodes for the calendar add-on that I purchased and installed today work fine. What would you like me to try next? |
|
Correction…neither of the lines before or after the shortcode printed. |
|
After doing some digging around in the EES_Espresso_Events class I worked through the process_shortcode function and commented out all but the return. The test page loaded fully. I then commented out less and less until the page crashed. The line causing the crash was the following: EED_Events_Archive::instance()->template_include( ‘loop-espresso_events.php’ ); After commenting just this line out the page loads and the events are show. I have a custom loop-espresso_events.php template, but renaming it so that it reverted back to the default didn’t help the crash with the above line being executed. I’m not quite sure why it seems to fully work with this line commented out, but it does. It even uses my custom loop-espresso_events.php template file. Can you shed any light on this? |
That’s odd. Can you enabled WP_DEBUG and see if any errors are being thrown with that line above active please? |
|
|
Tony, I enabled WP_DEBUG inside the function as shown below. If this is the correct way to implement it then it didn’t throw an error. The page just breaks. If I am not using WP_DEBUG correctly then let me know. If I am, then please tell me what else you would like me to try. public function process_shortcode( $attributes = array() ) { |
You can defined WPDebug from within a function, you need to do it within your wp-config.php file. Remove the code mentioned above, then using FTP navigate to your wordpress root directory and you’ll find wp-config.php there. Add /* That’s all, stop editing! Happy blogging. */ Like this – http://take.ms/JJQds Then reload that page. |
|
|
Here’s the error. It obviously doesn’t like the fact that I have the pagination function in my child theme’s functions.php. I don’t even remember why I put it there, it might have been for a previous version. Fatal error: Cannot redeclare espresso_pagination() (previously declared in /home/orthahee/public_html/atsicad/wp-content/themes/Avada-Child-Theme/functions.php:21) in /home/orthahee/public_html/atsicad/wp-content/plugins/event-espresso-core-reg/public/Espresso_Arabica_2014/functions.php on line 39 |
Hi, could you try commenting espresso_pagination out and re-testing? — |
|
|
I did that and it works fine now. Like I said, somewhere along the line I was told to put the pagination function in my child theme’s functions.php file but I can’t remember why. |
Alright, great! That may have been in a gist on GitHub that I shared on the support forums for starter templates. That was updated some time ago. — |
|
The support post ‘EE4 [ESPRESSO_EVENTS] Shortcode Doesn't Work’ 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.