Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /** Template Name: Events Page **/
- ?>
- <?php Utilities::get_template_parts( array( 'parts/shared/html-header', 'parts/shared/header' ) ); ?>
- <div class="wrapper">
- <?php query_posts(array( 'post_type' => 'events','meta_key' => 'date','orderby' => 'meta_value_num','order' => 'DESC' ) );?>
- <?php while (have_posts()) : the_post();?>
- <?php $date = DateTime::createFromFormat('Ymd', get_field('date'));?>
- <?php $currentdate = new DateTime();?>
- <?php if ($date > $currentdate) { ?>
- <div class="event-wrapper">
- <h1>Upcoming Event : <?php the_title();?></h1>
- <div class="row event-wrap">
- <div class="span_4 event-info">
- <h2>Event information</h2>
- <p><?php echo $date->format('l jS F Y'); ?> , <?php the_field('time');?></p>
- <p><?php the_field('event_location_');?></p>
- <button class="buttons">Become a speaker</button>
- <button class="buttons">Book Tickets</button>
- </div>
- <div class="span_8 event-speakers">
- <h2>Speakers</h2>
- <div class="row">
- <?php
- $speakers = get_field('speakers');
- if( $speakers ): ?>
- <?php foreach( $speakers as $speaker): ?>
- <div class="span_6 speaker">
- <div class="span_5">
- </div>
- <div class="span_7">
- <h3><?php echo $speaker->ID ;?></h3>
- <?php
- $args = array(
- 'post_type' => 'videos',
- 'meta_query' => array(
- 'relation' => 'AND',
- array(
- 'key' => 'speaker',
- 'value' => '$speaker->ID',
- 'compare' => 'LIKE'
- ),
- array(
- 'key' => 'events',
- 'value' => '$eventid',
- 'compare' => 'LIKE'
- )
- )
- );
- $videos = new WP_Query($args);
- if($videos->have_posts()) :
- while($videos->have_posts()) :
- $videos->the_post();
- ?>
- <!-- STUFF FOR EACH VIDEO HERE -->
- <?php the_field('youtube_videos');?>
- <?php endwhile; endif;?>
- </div>
- </div><!-- speaker -->
- <?php endforeach; ?>
- <?php wp_reset_postdata(); ?>
- <?php endif; ?>
- </div><!-- row -->
- </div><!-- event-speakers -->
- </div><!-- event wrap -->
- </div><!-- event wrapper -->
- <?php } ?>
- <?php endwhile;?>
- </div>
- <?php Utilities::get_template_parts( array( 'parts/shared/footer','parts/shared/html-footer' ) ); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement