Support

Home Forums Event Espresso Premium [ESPRESSO_EVENTS] shortcode not working nothing displays

[ESPRESSO_EVENTS] shortcode not working nothing displays

Posted: April 29, 2014 at 11:20 am


Joshua Nadal

April 29, 2014 at 11:20 am

I have created a page to list current events, and I followed the instructions to put the [ESPRESSO_EVENTS] shortcode on the page. The page loads, but nothing displays in the body where the events should be.

Chrome’s debugger returns this error: event.returnValue is deprecated. Please use the standard event.preventDefault() instead.

I have modified via child theme the archive-espresso_events.php file to fit better with my theme, but I checked it against the latest version and the EE code is exactly the same. Removing the file from the child theme so it defaults to the EE file didn’t change anything, either.

Any ideas? It used to work just a couple weeks ago.

EE 4.2.3.reg
WP 3.9


Lorenzo Orlando Caum

  • Support Staff

April 29, 2014 at 11:57 am

Hello,

The default events page (/events/) is virtual and should show the contents on its own. Does anything appear if you remove the shortcode from that WordPress page?


Lorenzo


Joshua Nadal

April 29, 2014 at 12:13 pm

No, still nothing. I am leaving the shortcode off for now.


Lorenzo Orlando Caum

  • Support Staff

April 29, 2014 at 2:37 pm

Could you temporarily activate the theme test drive plugin and enable any of the default WordPress themes and re-test?


Lorenzo


Joshua Nadal

April 30, 2014 at 10:23 am

Yes, it works with the Twenty-Thirteen WP theme. It also works with the un-modified default theme our site uses. It only fails when using the child theme, which means something is wrong with one of the EE files I modified. If I remove the archive-espresso_events.php file from the child theme, the events will show up on the page, but in all the wrong places (for example, the theme’s precontent area).

However, the EE code in the child theme’s archive-espresso_events.php is exactly the same as the main plugin, the only thing I change is the surrounding divs:

<?php get_template_part( 'loop', 'espresso_events' ); ?>

In fact, if I move the core EE archive-espresso_events.php file to the child theme without changing anything at all, it doesn’t work. That is, the events don’t load at all, not even in the wrong places.

Thus, I believe it is safe to say that the above line of code and the function it calls has something wrong with it that causes it to fail when executed from a child theme instead of the plugin’s original folder.


Joshua Nadal

April 30, 2014 at 11:01 am

Ok, I got it to work by additionally moving the loop-espresso_events.php file into the child theme, even though I don’t make any changes to it.

So that will work for now, but you should probably fix the function so that it will work even if the files are in separate folders. That would make it a lot more robust, as well as easier to modify. After all, only modified files should be in the child theme. Being forced to move supporting files, as we are in this case, defeats the point of a child theme; not to mention the fact that it is difficult/impossible to know which are the right supporting files to move.


Josh

  • Support Staff

April 30, 2014 at 1:54 pm

Hi Joshua,

I think there may be a misunderstanding with how the twentyfourteen child theme works. It’s not intended to load templates in the way you’re describing. In the rare case where a theme doesn’t work out of the box with Event Espresso, or someone wants to use these as a starter theme, we’ve made the templates available for tweaking. They are not intended to be used as a “copy one template over and everything will just work” type solution.

It might help to explain that in this specific case the function that you’re asking us to fix is get_template_part(), which is a core WordPress function. You can work around the issue you’re having with having two templates copied into your child theme by coping over the loop template’s content instead of using the get_template_part function.

The support post ‘[ESPRESSO_EVENTS] shortcode not working nothing displays’ 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.

Event Espresso