Advertisement
Guest User

Untitled

a guest
Nov 8th, 2013
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.56 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.  
  21.  
  22.  
  23. <img src="<?php the_field('image_of_map'); ?>" />
  24. <p><?php echo $date->format('l jS F Y'); ?> , <?php the_field('time');?></p>
  25. <p><?php the_field('event_location_');?></p>
  26. <button class="buttons">Become a speaker</button>
  27. <button class="buttons">Book Tickets</button>
  28. </div>
  29.  
  30. <div class="span_8 event-speakers">
  31. <h2>Speakers</h2>
  32.  
  33. <div class="row">
  34. <?php
  35. $posts = get_field('speakers');
  36. if( $posts ): ?>
  37. <?php foreach( $posts as $post): ?>
  38. <?php setup_postdata($post); ?>
  39. <div class="span_6 speaker">
  40. <div class="span_5">
  41. <img src="<?php the_field('speakers_image'); ?>" />
  42.  
  43. </div>
  44.  
  45. <div class="span_7">
  46. <h3><?php the_title();?></h3>
  47.  
  48.  
  49. <a class="OpenDialog" href="#">View Profile</a>
  50. </div>
  51. </div>
  52.  
  53. <?php endforeach; ?>
  54. <?php wp_reset_postdata(); ?>
  55. <?php endif; ?>
  56. </div>
  57. </div>
  58. </div>
  59. </div>
  60. <?php } else { ?>
  61. <div class="event-wrapper">
  62. <h1><?php the_title();?></h1>
  63. <?php $eventid = get_the_ID();?>
  64. <div class="row event-wrap">
  65. <div class="span_4 event-info">
  66. <h2>Event information</h2>
  67.  
  68.  
  69.  
  70. <img src="<?php the_field('image_of_map'); ?>" />
  71. <p><?php echo $date->format('l jS F Y'); ?> , <?php the_field('time');?></p>
  72. <p><?php the_field('event_location_');?></p>
  73. </div>
  74.  
  75. <div class="span_8 event-speakers">
  76. <h2>Speakers</h2>
  77.  
  78. <div class="row">
  79. <?php
  80. $posts = get_field('speakers');
  81. if( $posts ): ?>
  82. <?php foreach( $posts as $post): ?>
  83. <?php setup_postdata($post); ?>
  84. <div class="span_6 speaker">
  85. <div class="span_5">
  86. <img src="<?php the_field('speakers_image'); ?>" />
  87.  
  88. </div>
  89.  
  90. <div class="span_7">
  91. <h3><?php the_title();?></h3>
  92. <?php $videos = get_posts(array(
  93. 'post_type' => 'videos',
  94. 'meta_query' => array(
  95. 'relation' => 'AND',
  96. array(
  97. 'key' => 'speaker',
  98. 'value' => get_the_ID()
  99. ),
  100. array(
  101. 'key' => 'events',
  102. 'value' => $eventid
  103. )
  104. )
  105. ));
  106. ?>
  107.  
  108. <?php $videoquerys = new WP_Query($videos); ?>
  109.  
  110. <a class="" href="#">View Profile</a>
  111. </div>
  112. </div>
  113.  
  114. <?php endforeach; ?>
  115. <?php wp_reset_postdata(); ?>
  116. <?php endif; ?>
  117. </div>
  118. </div>
  119. </div>
  120. </div>
  121. <?php } ?>
  122. <?php endwhile;?>
  123. </div>
  124.  
  125. <?php Utilities::get_template_parts( array( 'parts/shared/footer','parts/shared/html-footer' ) ); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement