Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- wp_reset_query();
- $terms = get_the_terms(get_the_ID(), 'tribe_events_cat');
- $cats = array();
- if($terms) {
- foreach( $terms as $term ) {
- $cats[] = $term->slug;
- }
- }
- $catArray = implode( ',', $cats );
- global $post;
- $all_events = tribe_get_events(
- array(
- 'eventDisplay'=>'upcoming',
- 'posts_per_page'=>5,
- 'tax_query'=> array(
- 'relation' => 'OR',
- array(
- 'taxonomy' => 'tribe_events_cat',
- 'field' => 'slug',
- 'terms' => array($catArray),
- )
- )
- )
- );
- foreach($all_events as $post) {
- setup_postdata($post);
- ?>
- <li>
- <a class="white-font" href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
- </li>
- <?php } //endforeach ?>
- <?php wp_reset_query(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement