Site logo

[Support request] Query loop suddenly only shows current events and not all events

Home Forums Support [Support request] Query loop suddenly only shows current events and not all events

Home Forums Support Query loop suddenly only shows current events and not all events

Viewing 15 posts - 1 through 15 (of 16 total)
  • Author
    Posts
  • #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”?

    #2438394
    Fernando
    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?

    #2438402
    Marcel

    Hi Fernando, thanks for quick response. There are custom snippets but not related to filtering of events.

    #2438409
    Fernando
    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.

    #2438421
    Marcel

    just cleared all PHP snippets in functions.php, cleared cache and beside all lost effects the query loop didn’t work

    #2438730
    David
    Staff
    Customer Support

    Hi 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 ?

    #2438736
    Marcel

    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

    #2438901
    David
    Staff
    Customer Support

    How is post defined as being past is it just the date ? Or is there a post term such as a category or tag ?

    #2439766
    Marcel

    I guess because the event end date is before today, it’s not a setting in the query loop

    #2439816
    Ying
    Staff
    Customer Support

    Can you take a screenshot of the query loop settings?

    Let me know!

    #2440536
    Marcel

    see screenshot url in private area

    #2440718
    David
    Staff
    Customer Support

    That 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 the eventDisplay parameter 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-query

    #2440773
    Marcel

    Thanks David for you time and possible solutions! I tried your suggestion but it didn’t work, see url

    #2440875
    David
    Staff
    Customer Support

    Hmmm…. do you use any functions that change the the event calendars behaviour ?

    #2447624
    Marcel

    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.

Viewing 15 posts - 1 through 15 (of 16 total)
  • You must be logged in to reply to this topic.