Guest User

Untitled

a guest
May 23rd, 2018
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.66 KB | None | 0 0
  1. <?php
  2. $time= "12:00:00";
  3. $day= "20180705";
  4. $args = array(
  5. 'numberposts' => -1,
  6. 'post_type' => 'spectacles',
  7. 'post_status' => 'any',
  8. 'meta_query' => array(
  9. 'relation' => 'AND',
  10. array('key' => 'evenement_%_date_debut_evenement','compare' => '=','value' => $day),
  11. array('key' => 'evenement_%_heure_debut_evenement','compare' => '=','value' => $time),
  12. )
  13. );?>
  14.  
  15. <?php $the_query = new WP_Query( $args );?>
  16.  
  17. <?php if( $the_query->have_posts() ): ?><?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
  18.  
  19. <?php if (have_rows('evenement')) {while (have_rows('evenement')) {the_row();?>
  20. <?php if (get_sub_field('heure_debut_evenement', false) == $time && get_sub_field('date_debut_evenement', false) == $day ) { ?>
  21. <div><?php echo $time ;?> > <?php the_sub_field('heure_fin_evenement'); ?>
  22. <a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a> • <?php if( get_field('compagnie') ): ?><?php the_field('compagnie'); ?> • <?php endif;?><?php $post_object = get_sub_field('lieu_evenement');if( $post_object ):?>
  23. <?php $post = $post_object; setup_postdata( $post ); the_title();?>
  24. <?php wp_reset_postdata();?><?php endif;?></div><?php }}}?>
  25.  
  26. <?php endwhile; ?><?php endif;?>
  27. <?php wp_reset_query(); ?>
  28.  
  29. <!-- 12:30:00 -->
  30.  
  31. <?php
  32. $time= "12:30:00";
  33. $day= "20180705";
  34. $args = array(
  35. 'numberposts' => -1,
  36. 'post_type' => 'spectacles',
  37. 'post_status' => 'any',
  38. 'meta_query' => array(
  39. 'relation' => 'AND',
  40. array('key' => 'evenement_%_date_debut_evenement','compare' => '=','value' => $day),
  41. array('key' => 'evenement_%_heure_debut_evenement','compare' => '=','value' => $time),
  42. )
  43. );?>
  44.  
  45. <?php $the_query = new WP_Query( $args );?>
  46.  
  47. <?php if( $the_query->have_posts() ): ?><?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
  48.  
  49. <?php if (have_rows('evenement')) {while (have_rows('evenement')) {the_row();?>
  50. <?php if (get_sub_field('heure_debut_evenement', false) == $time && get_sub_field('date_debut_evenement', false) == $day ) { ?>
  51. <div><?php echo $time ;?> > <?php the_sub_field('heure_fin_evenement'); ?>
  52. <a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a> • <?php if( get_field('compagnie') ): ?><?php the_field('compagnie'); ?> • <?php endif;?><?php $post_object = get_sub_field('lieu_evenement');if( $post_object ):?>
  53. <?php $post = $post_object; setup_postdata( $post ); the_title();?>
  54. <?php wp_reset_postdata();?><?php endif;?></div><?php }}}?>
  55.  
  56. <?php endwhile; ?><?php endif;?>
  57. <?php wp_reset_query(); ?>
Add Comment
Please, Sign In to add comment