Advertisement
Guest User

Untitled

a guest
Nov 10th, 2013
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.47 KB | None | 0 0
  1. <?php
  2. /** Template Name: Events Page **/
  3. ?>
  4. <?php Utilities::get_template_parts( array( 'parts/shared/html-header', 'parts/shared/header' ) ); ?>
  5. <div class="wrapper">
  6.  
  7.  
  8.  
  9. <?php query_posts(array( 'post_type' => 'events','meta_key' => 'date','orderby' => 'meta_value_num','order' => 'DESC' ) );?>
  10.  
  11. <?php while (have_posts()) : the_post();?>
  12. <?php $date = DateTime::createFromFormat('Ymd', get_field('date'));?>
  13. <?php $currentdate = new DateTime();?>
  14. <?php if ($date > $currentdate) { ?>
  15. <div class="event-wrapper">
  16. <h1>Upcoming Event : <?php the_title();?></h1>
  17. <div class="row event-wrap">
  18. <div class="span_4 event-info">
  19. <h2>Event information</h2>
  20. <p><?php echo $date->format('l jS F Y'); ?> , <?php the_field('time');?></p>
  21. <p><?php the_field('event_location_');?></p>
  22. <button class="buttons">Become a speaker</button>
  23. <button class="buttons">Book Tickets</button>
  24. </div>
  25.  
  26. <div class="span_8 event-speakers">
  27. <h2>Speakers</h2>
  28.  
  29. <div class="row">
  30. <?php
  31. $speakers = get_field('speakers');
  32. if( $speakers ): ?>
  33. <?php foreach( $speakers as $speaker): ?>
  34. <div class="span_6 speaker">
  35. <div class="span_5">
  36.  
  37. </div>
  38.  
  39. <div class="span_7">
  40. <h3><?php echo $speaker->ID ;?></h3>
  41.  
  42. <?php
  43. $args = array(
  44. 'post_type' => 'videos',
  45. 'meta_query' => array(
  46. 'relation' => 'AND',
  47. array(
  48. 'key' => 'speaker',
  49. 'value' => '$speaker->ID',
  50. 'compare' => 'LIKE'
  51. ),
  52. array(
  53. 'key' => 'events',
  54. 'value' => '$eventid',
  55. 'compare' => 'LIKE'
  56. )
  57. )
  58. );
  59.  
  60. $videos = new WP_Query($args);
  61.  
  62. if($videos->have_posts()) :
  63. while($videos->have_posts()) :
  64. $videos->the_post();
  65.  
  66. ?>
  67.  
  68. <!-- STUFF FOR EACH VIDEO HERE -->
  69. <?php the_field('youtube_videos');?>
  70.  
  71. <?php endwhile; endif;?>
  72. </div>
  73. </div><!-- speaker -->
  74.  
  75. <?php endforeach; ?>
  76. <?php wp_reset_postdata(); ?>
  77. <?php endif; ?>
  78. </div><!-- row -->
  79. </div><!-- event-speakers -->
  80. </div><!-- event wrap -->
  81. </div><!-- event wrapper -->
  82. <?php } ?>
  83. <?php endwhile;?>
  84. </div>
  85.  
  86. <?php Utilities::get_template_parts( array( 'parts/shared/footer','parts/shared/html-footer' ) ); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement