Hi Team,
I have been struggling to arrange my events on a Blog post Gird Layout. Basically, using the events calendar pro, I am posting events and using the Blog Post grid layout to display them. The issue is, the blog post displays the event as when it was posted on WordPress instead, of arranging as per the EVENT date. The main problem happens as we post multiple events on the same day and it is not arranging as per the Event date instead of the blog post date.
I looking into a couple of forums maybe something like this : (which works for magazine)
https://kriesi.at/support/topic/events-date-in-magazine-element-not-creation-date/
or like this: https://kriesi.at/support/topic/enfold-masonry-sort-by-date-in-the-events-calendar/
If we could get this working it would be great.
Thanks,
Namgyal
Any assistance guys? Thanks.
Hi,
Sorry for the delay. You can use the filter that we provided in the following thread to adjust the order of the posts or events based on their start date.
// https://kriesi.at/support/topic/enfold-masonry-sort-by-date-in-the-events-calendar/#post-1280546
Just replace the avia_masonry_entries_query with avia_blog_post_query , and remove the conditional tag is_page.
Best regards,
Ismael
Thanks, Ismael for your reply. However, I did try the following code and it didn’t work. Any help?
/* The events calendar and blog post */
function avia_blog_entries_query_mod( $query, $params ) {
$include = array();
$events = tribe_get_events( [
‘posts_per_page’ => $query[“posts_per_page”],
‘start_date’ => ‘now’,
] );
foreach($events as $event) {
$include[] = $event->ID;
}
return $query;
}
add_filter(‘avia_blog_post_query’, ‘avia_blog_entries_query_mod’, 10, 2);
Hi,
We included this line in the filter.
unset($query['tax_query']);
And please note that this might not work as expected if there are recurring events.
Best regards,
Ismael
Hi Guys,
Thank you all for your support!
Cheers,
N