Nos Concessions
- 1,
'post_type' => 'concession'
);
$concession = new WP_Query( $concession_args );
$infos = [];
$vehicule_occasion_term = get_term_by( 'slug', 'vehicule-occasion', 'service' );
$vehicule_essai_term = get_term_by( 'slug', 'essai', 'service' );
$vehicule_neuf_term = get_term_by( 'slug', 'vehicule-neuf', 'service' );
if ( $concession->have_posts() ):
while ( $concession->have_posts() ): $concession->the_post();
$current_ID = get_the_ID();
$current_title = get_the_title();
$list_value = [];
foreach ( $list_meta as $meta ) {
$list_value[ $meta ] = get_field( $meta );
}
$infos[ $current_ID ] = array(
'title' => $current_title,
'lat' => $list_value['localisation']['lat'],
'lng' => $list_value['localisation']['lng'],
'id' => $current_ID
);
?>