Source > Source Based on Posts, Pages, Custom Posts * * @return array */ function essgrid_post_based_featured_events_w_featured_image( $query, $grid_id ) { /* YOU MUST CHANGE THESE TO YOUR OWN SLIDER REVOLUTION SLIDER IDs!!! */ $grid_ids_to_affect = array( 1, 2, 14 ); // include IDs of grids to affect // if this grid is not one to affect, do no filtering if ( ! in_array( $grid_id, $grid_ids_to_affect ) ) { return $query; } // get the existing meta_query so we aren't wiping that out if ( ! empty( $query['meta_query'] ) ) { $meta_query = (array) $query[ 'meta_query' ]; } else { $meta_query = []; } // do the filtering... // has a Featured Image $meta_query[] = array( 'compare' => 'BETWEEN', 'key' => '_thumbnail_id', 'value' => [ 1, PHP_INT_MAX ], ); // Restrict to events(posts) that have are featured events. if ( class_exists( 'Tribe__Events__Main' ) && class_exists( 'Tribe__Events__Featured_Events' ) && in_array( Tribe__Events__Main::POSTTYPE, (array) $query['post_type'] ) ) { $meta_query[] = [ 'compare' => 'EXISTS', 'key' => Tribe__Events__Featured_Events::FEATURED_EVENT_KEY, ]; } $query['meta_query'] = $meta_query; return $query; } add_filter( 'essgrid_get_posts', 'essgrid_post_based_featured_events_w_featured_image', 10, 2 );