-
AuthorPosts
-
August 28, 2019 at 6:33 pm #1131709
Howdy Folks!
I was following a thread on how to make the masonry blog with with only upcoming Modern Tribe events. I added this code there with the correct page #id and it makes the post above it vanish. When I remove the code from the functions.php everything s back in place BUT my events are showcasing past events. I also added the Events Calendar Pro Aggregator (that imports events from Google Calendar) and it’s not pulling those new events.
Thanks so much!!!
~AmandaHere’s the code that I added:
/* MODERN TRIBE CALENDAR FILTER*/
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(9002)) {
$query[‘post__in’] = $include;
}
return $query;
}
/* END MODERN TRIBE FILTER*/- This topic was modified 5 years, 3 months ago by amanda-mdllc.
September 2, 2019 at 6:52 am #1132842Hey amanda-mdllc,
Thank you for using Enfold.
and it makes the post above it vanish
What do you mean? What post? Please provide a link to the actual page containing the masonry element so that we can inspect it. You forgot to include the site URL above.
Best regards,
IsmaelSeptember 3, 2019 at 3:25 pm #1133408The actual page is our home page: Link is in the bottom.
When the php code is added for the Events Masonry to ONLY show the most recent events coming up, it makes the Blog Masonry section above it completely vanish when the code is added. When I take that code out again everything shows back up
September 4, 2019 at 9:47 am #1133725Hi,
Thank you for the clarification.
The items in the first masonry element vanish because the filter above is applied on both masonry elements. Are there any differences in the options between the two masonry elements? Maybe we can use that to exclude the other masonry element from the filter.
Best regards,
IsmaelSeptember 4, 2019 at 3:20 pm #1133880the Blog is a Recent Blog posts masonry & the events are coming over from Modern Tribes – Events Calendar.
The data that is being pulled in is from different sources.
September 5, 2019 at 12:23 pm #1134351Hi,
Thank you for the update.
We modified the condition a bit. The filter will only be applied when the taxonomy parameter is set to “tribe_events_cat”.
if(is_page(9002) && $params['taxonomy'] == 'tribe_events_cat') { $query['post__in'] = $include; }
Best regards,
IsmaelSeptember 5, 2019 at 3:20 pm #1134444That seemed to work perfectly! Thank you so much for all your help! You guys are AMAZING!!!!
~Amanda
September 5, 2019 at 5:03 pm #1134515Hi,
I’m glad this was resolved. If you need additional help, please let us know here in the forums.
Best regards,
Jordan Shannon -
AuthorPosts
- The topic ‘Enfold Masonry Blog – Modern Tribe Calendar & Other posts’ is closed to new replies.