| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546 | 
							- <?php
 
- /**
 
-  * The Template for displaying all single posts
 
-  *
 
-  * Methods for TimberHelper can be found in the /lib sub-directory
 
-  *
 
-  * @package  WordPress
 
-  * @subpackage  Timber
 
-  * @since    Timber 0.1
 
-  */
 
- $context         = Timber::context();
 
- $timber_post     = Timber::query_post();
 
- $context['post'] = $timber_post;
 
- $categories = get_the_terms( $id, 'category' );
 
- foreach ( $categories as $category ) {
 
-   $cat = $category->slug;
 
- }
 
- $current_id[] = get_the_ID();
 
- $args = get_posts(array(
 
-   'post_type' => 'post',
 
-   'post_status' => 'publish',
 
-   'orderby' => 'meta_value',
 
-   'meta_key' => 'informations_debut_event',
 
-   'order' => 'ASC',
 
-   'posts_per_page' => 6,
 
-   'category_name' => $cat,
 
-   'post__not_in' => $current_id,
 
-   'meta_query' => array(
 
-     array(
 
-         'meta_key'     => 'informations_end_event',
 
-         'value'   => date('Y-m-d H:i:s'),
 
-         'compare' => '>=',
 
-         'type'    => 'DATE',
 
-     ),
 
- ),
 
- ));
 
- $context['other'] = $args;
 
- Timber::render('single.twig', $context );
 
 
  |