Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #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!!!
    ~Amanda

    Here’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, 2 months ago by amanda-mdllc.
    #1132842

    Hey 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,
    Ismael

    #1133408

    The 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

    #1133725

    Hi,

    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,
    Ismael

    #1133880

    the 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.

    #1134351

    Hi,

    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,
    Ismael

    #1134444

    That seemed to work perfectly! Thank you so much for all your help! You guys are AMAZING!!!!

    ~Amanda

    #1134515

    Hi,

    I’m glad this was resolved. If you need additional help, please let us know here in the forums.

    Best regards,
    Jordan Shannon

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Enfold Masonry Blog – Modern Tribe Calendar & Other posts’ is closed to new replies.