Correction redirection form et affichage des events

This commit is contained in:
Gilles Van Assche 2024-11-29 13:49:01 +01:00
parent c16527615d
commit d7590b4603
3 changed files with 10 additions and 2 deletions

View File

@ -1,4 +1,7 @@
<?php get_header(); ?> <?php
acf_form_head();
get_header();
?>
<div class="container mx-auto my-8"> <div class="container mx-auto my-8">

View File

@ -4,7 +4,6 @@
<div class="clear-both"></div> <div class="clear-both"></div>
</div> </div>
<div class="form-add-event hidden opacity-0 transform scale-95 transition-all duration-500 my-4 py-8 px-12 bg-slate-200 rounded-md"> <div class="form-add-event hidden opacity-0 transform scale-95 transition-all duration-500 my-4 py-8 px-12 bg-slate-200 rounded-md">
<?php acf_form_head(); ?>
<?php <?php
acf_form(array( acf_form(array(
'post_id' => 'new_post', 'post_id' => 'new_post',
@ -15,6 +14,7 @@
'submit_value' => 'Ajouter un événement', 'submit_value' => 'Ajouter un événement',
'post_title' => true, 'post_title' => true,
'field_groups' => array('group_67405fd4d1648'), 'field_groups' => array('group_67405fd4d1648'),
'return' => site_url('/'),
)); ));
?> ?>
</div> </div>

View File

@ -3,6 +3,11 @@
// WP_Query arguments // WP_Query arguments
$args = array( $args = array(
'post_type' => 'evenements', 'post_type' => 'evenements',
'posts_per_page' => -1,
'meta_key' => 'date_debut', // Nom du champ ACF
'orderby' => 'meta_value', // Trier par la valeur du champ
'order' => 'ASC', // Ordre croissant ('DESC' pour décroissant)
'meta_type' => 'DATE' // Préciser que c'est une date (important)
); );
// The Query // The Query