-
AuthorPosts
-
January 26, 2018 at 2:24 pm #903391
I have the same request! On my home page, I use several masonry, including one to list upcoming events!
1- I would like to post only upcoming events by date of the event!
2- In addition, I would like to display with the title the date of the event and the time of it!*——————————————————————– Tried code ————————————————————————*
add_filter(‘avia_masonry_entries_query’, ‘avia_masonry_entries_query_mod’, 10, 2);
function avia_masonry_entries_query_mod( $query, $params ) {
$eventquery = array(‘paged’=> false, ‘eventDisplay’ => ‘list’);
$upcoming = Tribe__Events__Query::getEvents( $eventquery, true);
$include = array();foreach($upcoming->posts as $key => $event) {
$include[] = $event->ID;
}
if(is_page(24)) {
$query[‘post__in’] = $include;
}
return $query;
}
*———————————————————————————————————————————————————————–*# 1) When I put the code in the functions.php file …. the filter works partially … many events are not displayed … the filters and the load more button disappear !!!
# 2) I locate the file av-helper-masonry.php … how do I add the code to display the date and time of the event?
I forgot to restrain the fact, when I put the code, all the masonry disappear from the page! Can we do this only for a specific mansonry ID?
On my homepage, I have a masonry portfolio, a masonry post and a masonry events !!!
I do not want the code to affect the other masonry of the page!
web site : http://delerabliere.ca/
Can you help me ?
Thanks for your help !January 30, 2018 at 4:32 am #904598Hey beauch66,
Thank you for using Enfold.
Please replace the filter with the following code.
add_filter('avia_masonry_entries_query', 'avia_masonry_entries_query_mod', 10, 2); function avia_masonry_entries_query_mod( $query, $params ) { $eventquery = array('paged'=> false, 'eventDisplay' => 'list'); $upcoming = Tribe__Events__Query::getEvents( $eventquery, true); $include = array(); foreach($upcoming->posts as $key => $event) { $include[] = $event->ID; } $query['tax_query'] = array(); $query['post__in'] = $include; return $query; }
And then modify the av-helper-masonry.php file, look for this code around line 333:
$items .= " <h3 class='av-masonry-entry-title entry-title' {$markup}>{$the_title}</h3> ";
Below, add the date modification.
$start = tribe_get_start_date($entry['ID']); $items .= "<time>{$start}</time>";
Best regards,
IsmaelJanuary 30, 2018 at 2:57 pm #904925Hi Ismael ;-)
When I put the filter code in the file function.php … 2 major errors follow:
1- The code affects the other masonry of the page and even the masonry of the other pages !!!
2- I get the events to come … but the code does not take into account the selected categories!
Can you help me solve this problem?
Thanks for your help …
January 31, 2018 at 6:48 am #905382Hi,
I would like to edit the modification but I get an error in the Appearance > Editor panel. Please provide the FTP details in the private field.
1.) On which masonry element would you like to apply the modification?
2.) I’m sorry but you can’t combine events and the default posts. Once the code is in effect, it will only display events.
Best regards,
Ismael -
AuthorPosts
- You must be logged in to reply to this topic.