Support

Home Forums Event Espresso Premium Do you guys know of any issues with Shortcodes & Elementor?

Do you guys know of any issues with Shortcodes & Elementor?

Posted: March 28, 2024 at 3:22 pm

Viewing 13 reply threads


scaldwell

March 28, 2024 at 3:22 pm

Got up this morning and only 1 pages of shortcodes was working. Turns out the reason it was working was because we have 2 of them on the page. I had to duplicate the shortcodes on all our pages so that the classes were showing.

https://portlandfashioninstitute.com/classes/design-classes-2/

Please help


Rio

  • Support Staff

March 28, 2024 at 6:47 pm

Can you tell us what shortcode are you using and the parameter inside.

If you can take a screenshot of those you added in the code editor, that would be fantastic.

thanks


scaldwell

March 31, 2024 at 12:22 pm

As a side note, the Event Posts widget in Elementor no longer displays events. This was working last week but now it doesn’t work.

We’ve tried multiple shortcodes, but here are some samples:

I had to add this shortcode twice to get to show on the home page:
https://portlandfashioninstitute.com/
[ESPRESSO_EVENTS category_slug=class-promo-events]
*I had to replace the Posts widget with the shortcode because the elementor widget is no longer working. We’re really not happy with the way this looks but it’s better than not having the classes show up at all.

On this page: https://portlandfashioninstitute.com/classes/design-classes-2/
We have to have 2 of these shortcodes to make it work (this is true for all class pages)
[ESPRESSO_GRID_TEMPLATE sort=ASC default_image=/wp-content/uploads/2018/09/featured-image-temp.jpg category_slug=design limit=45]

Screenshot https://prnt.sc/bafS7fK57LuB

* we tried the shortcode elementor widget and the text editor – which is what we have now… we have 2 text widgets. If there is just one, it won’t show any classes.


Rio

  • Support Staff

April 1, 2024 at 12:10 am

I did try to recreate the issue but no luck.

Have you tried checking if there’s possible plugin or theme conflict?
Do you see any error log too? here’s the guide
https://eventespresso.com/wiki/troubleshooting-checklist/

on checking theme or plugin conflict, you can use plugin such as this
https://wordpress.org/plugins/health-check/ or any similar plugin.

You can do the above using Troubleshooting mode:

Tools -> Site Health -> Troubleshooting -> Enabled Troubleshooting mode.

That will disable all plugins and switch to a default theme and then allow you to enable specific plugins troubleshooting mode. Once disabled you will revert back to the current state.

thanks


scaldwell

April 1, 2024 at 11:54 am

Hi there Rio –
So I was able to track this down to some custom codes we were given to make some other things on our site work with EE. If I remove them (they are on the functions.php file of my child theme) then the shortcodes work fine. So it’s something in these scripts that is doing this… BUT I’m not sure which part is the problem – can you tell me?

//Custom shortcode for displaying the tickets on events/class page.
function custom_ticket_selector_shortcode() {
$get_event_post_id = get_the_ID();

$display_tickets = ‘[ESPRESSO_TICKET_SELECTOR event_id=”‘. $get_event_post_id .'”]’;

return $display_tickets;
}
add_shortcode(‘custom_ticket_selector’, ‘custom_ticket_selector_shortcode’);

function searchfilter($query) {

if ($query->is_search && !is_admin() ) {
$query->set(‘post_type’,array(‘espresso_events’));
}

return $query;
}

add_filter(‘pre_get_posts’,’searchfilter’);

function de_ee_tweak_event_list_exclude_ticket_expired_events_where( $SQL, WP_Query $wp_query ) {
if ( isset( $wp_query->query_vars[‘post_type’] ) && ( $wp_query->query_vars[‘post_type’] == ‘espresso_events’ || ( is_array( $wp_query->query_vars[‘post_type’] ) && in_array( ‘espresso_events’, $wp_query->query_vars[‘post_type’] ) ) ) && ! $wp_query->is_singular ) {
$SQL .= ‘ AND Ticket.TKT_end_date > “‘ . current_time( ‘mysql’, true ) . ‘” AND Ticket.TKT_deleted=0’;
}
return $SQL;
}
add_filter( ‘posts_where’, ‘de_ee_tweak_event_list_exclude_ticket_expired_events_where’, 15, 2 );
function de_ee_tweak_event_list_exclude_ticket_expired_events_join( $SQL, $wp_query ) {
if ( isset( $wp_query->query_vars[‘post_type’] ) && ( $wp_query->query_vars[‘post_type’] == ‘espresso_events’ || ( is_array( $wp_query->query_vars[‘post_type’] ) && in_array( ‘espresso_events’, $wp_query->query_vars[‘post_type’] ) ) ) && ! $wp_query->is_singular ) {
if ( ! $wp_query->is_espresso_event_archive && ! $wp_query->is_espresso_event_taxonomy ) {
$SQL .= ‘ INNER JOIN ‘ . EEM_Datetime::instance()->table() . ‘ ON ( ‘ . EEM_Event::instance()->table() . ‘.ID = ‘ . EEM_Datetime::instance()->table() . ‘.’ . EEM_Event::instance()->primary_key_name() . ‘ ) ‘;
}
$SQL .= ‘ INNER JOIN ‘ . EEM_Datetime_Ticket::instance()->table() . ‘ AS Datetime_Ticket ON ( Datetime_Ticket.DTT_ID=’ . EEM_Datetime::instance()->table() . ‘.’ . EEM_Datetime::instance()->primary_key_name() . ‘ ) INNER JOIN ‘ . EEM_Ticket::instance()->table() . ‘ AS Ticket ON ( Datetime_Ticket.TKT_ID=Ticket.’ . EEM_Ticket::instance()->primary_key_name() . ‘ ) ‘;
}
return $SQL;
}
add_filter( ‘posts_join’, ‘de_ee_tweak_event_list_exclude_ticket_expired_events_join’, 3, 2 );


Rio

  • Support Staff

April 2, 2024 at 12:19 am

We do have reported bug regarding to some snippet not working in 5.0.19, this is being taken care of by our developers the fix is still under series of testing, once it passed the test it will be roll out soon.

Thanks


scaldwell

April 2, 2024 at 10:07 am

Ok – would any of this have an effect on losing date/times in the admin? They are reporting that when they go in to edit a class date/time (for example they sell class seats on site and not through the website on occasion, they will login, go to the class and change the number of seats available). They will update the number of seats for one of the date/times – UPDATE the class and then find that ALL the datetimes are GONE. I cannot duplicate this issue – however it does not seem to happen all the time. THEY continue to have it happen to them… Any thoughts on this please? They are truly freaking out.


Tony

  • Support Staff

April 2, 2024 at 10:16 am

Hi Shelly,

No, it shouldn’t but if your happy for me to clone the site locally and can try to reproduce that locally without messing up your events.

If that’s ok, I’ll log in and use Updraft to clone the site then just need a run down of the steps they are taking for this to happen.

For the issue you are currently getting on the front end, I can give you an updated version of the snippets above to fix the issue for now but it may also need to be updated again once we ‘fix’ core.

The issue is with the code after this line:

add_filter(‘pre_get_posts’,’searchfilter’);

Replace that code with this:

https://gist.github.com/Pebblo/f6999040cf2df3965c1b75ac99f9c20b

But again, this may need to be updated.


scaldwell

April 2, 2024 at 10:26 am

Oh great! I will do that. Perfect.
Sure – clone away. I also have a clone of the site on Flywheel staging that I can give you access to. The thing is, I can’t replicate this. It only happens occasionally…


scaldwell

April 2, 2024 at 10:30 am

Odd thing happens when I try to replace that code

https://prnt.sc/5-H2ATt_eZRF


scaldwell

April 2, 2024 at 10:32 am

Was I supposed to replace everythign below that line, or just that one function.
I only deleted that function, not every single line…


scaldwell

April 2, 2024 at 10:33 am

Yeah. I’m an idiot. Sorry. WOrking now


Tony

  • Support Staff

April 2, 2024 at 10:52 am

Sure – clone away. I also have a clone of the site on Flywheel staging that I can give you access to.

Can you send me the credentials using this form:

https://eventespresso.com/send-login-details/

The system throwing a fatal error showing 300MB of memory has been used when updating a file… is possibly a symptom of whatever is happening when your users update events.

If that’s happening when they update it can have unexpected results, half a request runs and updates the event but runs out of memory when updating the datetime relationships for example.


scaldwell

April 2, 2024 at 6:06 pm

Do you know if part of the script I replaced here in the functions.php file could result in sold out classes not showing, because now the client is complaining that our sold out classes are not showing with the shortcodes. They want people to be able to sign up for a wait list. Was that possible before I replaced our code with this new stuff?


Tony

  • Support Staff

April 3, 2024 at 5:03 pm

I’ve been digging into this and I’m using the above code to filter out the events in the same way you are, sold out events still show up for me:

https://monosnap.com/file/m3DuLrCBS3gc5vSSQ7znQ1sp4LqL6X

The only way the above snippet should be filtering those events out is if all of the tickets in the event have the Ticket Sale end date set in the past (in which case Waitlist options would be available anyway).

Can you link me to a list that they think events would normally show the waitlist event on and a sold out event that should be showing on that list? I’ll check into both.


scaldwell

April 3, 2024 at 5:06 pm

We have figured out this particular issue. But would love to know the cause of the disspearing datetimes (literally tickets and dateimes get deleted) upon Updating the event’s available seats.

Viewing 13 reply threads

The support post ‘Do you guys know of any issues with Shortcodes & Elementor?’ 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