Created
July 18, 2022 13:44
-
-
Save shahzaibkhan/8baec59a1cc58429dd97faf88bb1739d to your computer and use it in GitHub Desktop.
featured_query_event_calendar
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$featured_query = new WP_Query(); | |
$featured_query->query(array( | |
'post_type' => 'tribe_events', | |
'posts_per_page' => '1', | |
'orderby' => 'rand', | |
'eventDisplay' => 'upcoming', | |
'tax_query' => array( | |
array( | |
'taxonomy' => 'tribe_events_cat', | |
'field' => 'slug', | |
'terms' => 'featured', | |
'operator' => 'IN' | |
), | |
), | |
)); | |
if ($featured_query->have_posts()) : | |
while ( $featured_query->have_posts() ) : $featured_query->the_post(); | |
// show the event here with whatever function you need | |
die(var_dump($post)); | |
endwhile; | |
endif; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment