Posted: May 29, 2020 at 12:40 pm
We’ve had an ongoing issue with displaying events that have expired. The issue was are having is we are using WP Bakery post grid to display events. There doesn’t seem to be a page element that has a filter for event status. I’m searching for a solution the works for the client so they don’t have to keep going in and publishing manually once an event has expired. Thank you |
|
following |
|
Hi there, Is there a filter on the query used within WP Bakery post grid? If so should be able to help with a snippet to exclude expired events. |
|
There are filters in the WP Bakery post grid element but none that will filter out expired events. My developer is not sure how much coding there is to do. My thought was this may be a common issue as WP Bakery is very popular. Another thought was a third-party developer might be able to offer an add-on for this. Any other assistance would be greatly appreciated. Thank you! |
|
I’m referring to filters within the code itself, it sounds like you might using the same term for filters within post grid settings?
I’d need to see the plugin, can you send a copy over?
I don’t remember any other threads for WP Bakery Post Grid but that doesn’t mean there aren’t any but this certainly hasn’t been a common question.
Apologies but I’m not sure I follow, add-on for which? |
|
This reply has been marked as private. | |
You’ll need to host the zip file somewhere (the site itself for example) and then include a link we can use to download it. Or email it using a service such as WeTrasnfer to send a copy to support[at]eventespresso.com |
|
This reply has been marked as private. | |
Ok, so this is actually very simple to do as we have a function to filter events with expired tickets: Add that to a custom functions plugin on the site, we have documentation on how here: https://eventespresso.com/wiki/create-site-specific-plugin-wordpress-site/ Then, WP Bakery are expressing filters within their queries but they have a filter for it, so in that same plugin you just created add:
That will remove events with expired ticket sales from the output, not it will do so everywhere on the site so if you want it to only happen on specific pages you’ll need to add conditionals to those functions. |
|
Thank you so much for your incredible support. We have implemented the code on our staging site and it seems to be working for some events but not others. Working: Not Working: If you have any ideas why this might be the case we’d very much appreciate it. Thank you! |
|
What events should I see on those ‘not working’ pages? Right now no events load but that doesn’t necessarily mean the snippet isn’t working. Have you checked the error log to confirm there are no errors being thrown? |
|
We can see there should be some events not expired on live site: https://www.jansenartcenter.org/classes/jewelry/ We are getting this: The post type tp_event is not registered, so it may not be reliable to check the capability “edit_post” against a post of that type. Please see Debugging in WordPress for more information. (This message was added in version 4.4.0.) in /mnt/data/home/154226.cloudwaysapps.com/yypkxkvndy/public_html/wp-includes/functions.php on line 5167 |
|
Uninitialized string offset: 0 in /mnt/data/home/154226.cloudwaysapps.com/yypkxkvndy/public_html/wp-content/plugins/wp-hummingbird/core/modules/minify/class-uri-rewriter.php on line 128 |
|
Wait! I think we found a conflicting plugin. Ultimate VC addons is causing the error. |
|
That looks like its from your sites theme or possible another plugin.
Hummingbird is an optimization plugin, so again those aren’t from Event Espresso.
Ok, so what is that plugin doing? |
|
[11-Jun-2020 16:02:14 UTC] PHP Notice: Undefined index: license-form-method in /mnt/data/home/154226.cloudwaysapps.com/yypkxkvndy/public_html/wp-content/plugins/Ultimate_VC_Addons/admin/bsf-core/BSF_License_Manager.php on line 619 Trying to track down the issue. Here’s the code: if ( ‘edd’ === $product[‘license_from_type’] || ‘license-key’ === sanitize_text_field( $_GET[ ‘license-form-method’ ] ) ) { |
|
A PHP Notice or Warning wouldn’t usually cause any significant issues, its essentially saying ‘you might want to check this out’. ‘Fatal Errors’ are the ones that will stop the script executing and cause no results/blanks screens etc. So are you sure that plugin is actually conflicting? Have you tried temporarily disabling it to see if the pages then work as expected? |
|
Hi Tony, So you were correct. I disabled all plugins and changed the theme and the problem still exists. I changed the page element of WP Bakery and just switching the categories made the results not return anything. I’m scratching my head here. None of the errors seem to indicate the problem. Is there possibly something on the EE side that could be buried in the data causing this? After experimenting a little further I’ve pinpointed the problem only seems to be with a few categories. I may try to remove those and reapply. This seems like a possible data issue. |
|
Ok, this is why I asked for specific events I should be looking for above. The snippet filters events based on the ticket sale dates set within the event NOT the event status. So, on this page: https://www.jansenartcenter.org/classes/jewelry/ I’m guessing it’s only the first 3 events that should be showing? |
|
Oh! Yes, that’s correct. We only want active or upcoming. It looks like once the event Is passed then it goes to an inactive status? |
|
That’s correct because the Event status is based on the datetimes, not the ticket sales dates. Looks like that snippet isn’t going to work for your event set up. Can you edit this event: https://www.jansenartcenter.org/events/stackable-rings-2/ Take a screenshot of the ‘Event Tickets and Datetimes’ section for the event and post it here, please? |
|
OK, now that makes sense. Here’s the screenshot https://tinyurl.com/y8sgmm4s |
|
Hmm, actually that should still be excluded by that snippet. It’s only a single ticket on the event and the sale dates have passed. Let’s break this down a little more, what exactly did you do here:
What do you have set on the above page to display the events? |
|
Here’s where the filter is set in WP Bakery. https://tinyurl.com/y7pt3fd4 After experimentation, it seemed like some categories worked and some didn’t. To me it seemed there could be a data problem. I made a test event and put it in Ceramics with a future date and it showed up. So it’s almost like the old events don’t work but new ones do. |
|
Within EE there is no difference between categories, they are all created in exactly the same way.
As in?
Sorry but I don’t follow your logic here, you created an event that was expected to show up (it has a future date) and it did actually show up. How that shows any issue with a query that is filtering out events that have ticket sale end dates set in the past, I’m not sure. In short, your new test event is expected to show up with that snippet, regardless of the category set. |
|
So, I ran another experiment. I recreated the event identical to the one not showing up and it did. http://wordpress-154226-1333449.cloudwaysapps.com/test/ So it seems there’s a problem in the database. We may try to workaround and just have them recreate the events that aren’t working. |
|
I guess I’m misunderstanding the problem here. Can you provide more specific details of the events in question, please? I’m not sure what I should be looking at/comparing against. |
|
Hi Tony, I’m following up so this thread isn’t left hanging. I love the support you guys have provided, truly over the top. For some reason the filter isn’t working on some existing categories. It works on new ones we create so our workaround seems to be to recreate the categories. I’ll follow up if we have any more problems. Thank you! |
|
Ah ok, that’s a little strange as it shouldn’t really make any difference but sound like you have it handled anyway. Thanks for the follow up, and feedback 🙂 |
|
The support post ‘Remove expired events from website view’ 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.