Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- global $post;
- $current_date = date('j M Y');
- /* get upcoming 30 day event, you can edit this to less day */
- $end_date = date('j M Y', strtotime('30 days'));
- $terms = get_terms( 'tribe_events_cat', 'hide_empty=0' );
- foreach($terms as $tribe_category){
- echo '<div class="event-wrapper">';
- /* Featured Event */
- $all_events_one = tribe_get_events(
- array(
- 'start_date' => $current_date,
- 'end_date' => $end_date,
- 'eventDisplay' => 'upcoming',
- 'posts_per_page'=> 1,
- 'tax_query'=> array(
- array(
- 'taxonomy' => 'tribe_events_cat',
- 'field' => 'slug',
- 'terms' => $tribe_category
- )
- )
- )
- );
- /* Sub Event */
- $all_events_two = tribe_get_events(
- array(
- 'start_date' => $current_date,
- 'end_date' => $end_date,
- 'eventDisplay' => 'upcoming',
- 'posts_per_page'=> 3,
- 'offset' => 1,
- 'tax_query'=> array(
- array(
- 'taxonomy' => 'tribe_events_cat',
- 'field' => 'slug',
- 'terms' => $tribe_category
- )
- )
- )
- );
- foreach($all_events_one as $featured) {
- setup_postdata($featured);
- ?>
- <div class="featured">
- <h3><?php the_title(); ?></h3>
- <span class="event-date"><a href="<?php the_permalink(); ?>"><?php echo tribe_get_start_date($post->ID, true, 'M j, Y'); ?></a></span>
- <?php if ( has_post_thumbnail() ) { ?>
- <div class="event-thumb">
- <a href="<?php the_permalink(); ?>"><?php the_post_thumbnail('thumbnail'); ?></a>
- </div>
- <div class="event-excerpt">
- <?php the_excerpt(); ?>
- </div>
- <?php } else { ?>
- <div class="event-content">
- <?php the_content(); ?>
- </div>
- <?php } ?>
- </div>
- <?php } //endforeach
- wp_reset_query(); ?>
- <!-- start sub-event -->
- <div class="ca-wrapper">
- <?php
- foreach($all_events_two as $sub_event) {
- setup_postdata($sub_event);
- ?>
- <div class="ca-item ca-item-1">
- <div class="ca-item-main">
- <div class="ca-icon"></div>
- <h3><?php the_title(); ?></h3>
- <h4>
- <span class="ca-quote">“</span>
- <span><?php the_excerpt(); ?></span>
- </h4>
- <a href="#" class="ca-more">more...</a>
- </div>
- <div class="ca-content-wrapper">
- <div class="ca-content">
- <?php the_content(); ?>
- </div>
- </div>
- </div>
- <?php } // end foreach
- wp_reset_query(); ?>
- <!-- end sub-event -->
- </div>
- <?php
- echo '</div>';
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement