The first step is to create a post type and then install ACF Advanced Custom Field. Types does too, but experience ACF is Simpler to manage.
Consequently we will create custom fields for our Post Type.
<?php
query_posts(array(
'post_type' => 'evenement',
'cat' => 2, // La catégorie visée
'meta_query' => array(
array(
'key' => 'date', // Le champ personnalisé
'value' => '"19"', // La valeur désiré
'compare' => 'LIKE', //
)
)
) );
?>
<?php while (have_posts()) : the_post(); ?>
<h2><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h2>
<p><?php echo get_the_excerpt(); ?></p>
<?php endwhile;?></li>