|
@@ -2,6 +2,7 @@
|
|
|
/**
|
|
|
* template name: Accueil
|
|
|
*/
|
|
|
+
|
|
|
use Timber\Post;
|
|
|
use Timber\Timber;
|
|
|
|
|
@@ -9,8 +10,6 @@ $context = Timber::get_context();
|
|
|
$post = new Post();
|
|
|
$context['post'] = $post;
|
|
|
|
|
|
-$args = 'post_type=post&numberposts=3&orderby=date';
|
|
|
-
|
|
|
$projet = array(
|
|
|
'post_type' => 'les-projets',
|
|
|
'post_status'=>'publish',
|
|
@@ -23,6 +22,22 @@ $tpsF = array(
|
|
|
'numberposts' => 3
|
|
|
);
|
|
|
|
|
|
+$today = date('Y-m-d H:i:s');
|
|
|
+
|
|
|
+$args = array (
|
|
|
+ 'post_type' => 'post',
|
|
|
+ 'orderby' => 'informations_debut_event',
|
|
|
+ 'order' => 'ASC',
|
|
|
+ 'meta_query' => array(
|
|
|
+ array(
|
|
|
+ 'key' => 'informations_debut_event',
|
|
|
+ 'compare' => '>=',
|
|
|
+ 'value' => $today,
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ 'numberposts' => 3
|
|
|
+);
|
|
|
+
|
|
|
$context['projet'] = Timber::get_posts( $projet );
|
|
|
$context['posts'] = Timber::get_posts( $args );
|
|
|
$context['tpsF'] = Timber::get_posts( $tpsF );
|