Advertisement
Guest User

Untitled

a guest
Nov 5th, 2013
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.13 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',
  10. 'meta_key' => 'date', // name of custom field
  11. 'orderby' => 'meta_value_num',
  12. 'order' => 'DESC' ) );?>
  13.  
  14. <?php while (have_posts()) : the_post();?>
  15. <div class="event-wrapper">
  16. <h1><?php the_title();?></h1>
  17. <div class="row event-wrap">
  18. <div class="span_4 event-info">
  19. <h2>Event information</h2>
  20.  
  21. <?php $date = DateTime::createFromFormat('Ymd', get_field('date'));?>
  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. </div>
  43.  
  44. <div class="span_7">
  45. <h3><?php the_title();?></h3>
  46.  
  47. <?php if(get_field('speaker_topic')): ?>
  48.  
  49. <?php while(has_sub_field('speaker_topic')): ?>
  50. <?php // if(get_sub_field('event') ) {?>
  51. <p><?php// the_sub_field('topic'); ?></p>
  52. <?php// } ?>
  53. <?php endwhile; ?>
  54.  
  55. <?php endif; ?>
  56. <a class="OpenDialog" href="#">View Profile</a>
  57. </div>
  58. </div>
  59.  
  60. <?php endforeach; ?>
  61. <?php wp_reset_postdata(); ?>
  62. <?php endif; ?>
  63. </div>
  64. </div>
  65. </div>
  66. </div>
  67. <?php endwhile;?>
  68. </div>
  69.  
  70. <?php Utilities::get_template_parts( array( 'parts/shared/footer','parts/shared/html-footer' ) ); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement