- This topic has 15 replies, 4 voices, and was last updated 3 years, 4 months ago by
David.
-
AuthorPosts
-
November 28, 2022 at 1:04 am #2438383
Marcel
We created a website of an artists collective and on every artist “page” we use a GBP query loop to show all the events (exhibitions) he/she worked with.
It all worked until a few weeks ago. Don’t know if it was a GBP update or The Events Calendar but it used to show all events and now only current/future.
How to revert this into “show all events of tag”?
November 28, 2022 at 1:16 am #2438394Fernando Customer Support
Hi Marcel,
Inherently, it should show all posts/events by default. Can you check if you have custom PHP snippets that could cause such filtering?
November 28, 2022 at 1:25 am #2438402Marcel
Hi Fernando, thanks for quick response. There are custom snippets but not related to filtering of events.
November 28, 2022 at 1:29 am #2438409Fernando Customer Support
To be sure, can you try temporarily removing all PHP snippets added through Code Snippets or functions.php?
Let us know how it goes. It would be good to take a backup of your site before doing this.
November 28, 2022 at 1:36 am #2438421Marcel
just cleared all PHP snippets in functions.php, cleared cache and beside all lost effects the query loop didn’t work
November 28, 2022 at 5:11 am #2438730David
StaffCustomer SupportHi there,
just so i am clear on the issue.
Before: the artist page would show ALL Events including any Events that had finished ?
After: the artist page only shows events that are currently available ?Is that correct ?
November 28, 2022 at 5:16 am #2438736Marcel
Little bit more specific: BEFORE it showed ALL events by artist tag (past, current and future) and AFTER it shows only events by artist tag that are current or future
November 28, 2022 at 6:58 am #2438901David
StaffCustomer SupportHow is post defined as being
pastis it just the date ? Or is there a post term such as a category or tag ?November 28, 2022 at 12:47 pm #2439766Marcel
I guess because the event end date is before today, it’s not a setting in the query loop
November 28, 2022 at 1:27 pm #2439816Ying
StaffCustomer SupportCan you take a screenshot of the query loop settings?
Let me know!
November 29, 2022 at 1:45 am #2440536Marcel
see screenshot url in private area
November 29, 2022 at 3:57 am #2440718David
StaffCustomer SupportThat is rather odd, as you’re not defining any query parameters to exclude past dates.
I had a search on the plugins docs and found they use theeventDisplayparameter in their queries.
And by setting it to'eventDisplay' => 'custom'you can avoid there being any assumptions.So try:
1. Add this PHP Snippet to your site:
add_filter( 'generateblocks_query_loop_args', function( $query_args, $attributes ) { // Check your logic to apply the filtering only to specific loop if ( ! empty( $attributes['className'] ) && strpos( $attributes['className'], 'tec-query' ) !== false && ! is_admin() ) { // Merge the current $query_args which contains arguments defined in the editor with your ordering arguments return array_merge( $query_args, array( 'eventDisplay' => 'custom', ) ); } return $query_args; }, 10, 2 );2. Select the Grid Block found inside the Query Loop block, and in Advanced > Additional CSS Class(es) add:
tec-queryNovember 29, 2022 at 4:39 am #2440773Marcel
Thanks David for you time and possible solutions! I tried your suggestion but it didn’t work, see url
November 29, 2022 at 6:12 am #2440875David
StaffCustomer SupportHmmm…. do you use any functions that change the the event calendars behaviour ?
December 3, 2022 at 1:08 am #2447624Marcel
Hi David,
sorry for my late response I was on the road for 3 days.
Shall I give you access to the website?
There are extra TEC functions (translate strings) but I already deleted them to test after Fernando asked but that didn’t worked either.
-
AuthorPosts
- You must be logged in to reply to this topic.