<?php
$hay_exposiciones = false;
$date_string = date('Y-m-d');
$meta_query['relation'] = 'AND';
array_push($meta_query, array(
'key' => 'fecha_fin',
'value' => $date_string,
'compare' => '>='
));
$query = new WP_Query(array(
'posts_per_page' => 4,
'post_type' => array('exposicion'),
'meta_query' => $meta_query,
'meta_key' => 'tipo_exposicion',
'orderby' => 'meta_value',
'order' => 'ASC'
));
?>
<div class="row exposicion-home">
<?php
while ($query->have_posts()) : $query->the_post();
$hay_exposiciones = true;
$exposicion_title = get_the_title();
$exposicion_permalink = get_the_permalink();
$exposicion_etiquetas = get_the_category();
$exposicion_video = get_field('video_principal');
if(is_array(get_field('image_principal_listado'))){
$exposicion_imagen = get_field('image_principal_listado')['sizes']['listado-thumb'];
}else{
$exposicion_imagen = wp_get_attachment_image_src(get_field('image_principal_listado'), 'listado-thumb')[0];
}
$exposicion_subtitle = get_field('subtitulo_autor');
$exposicion_descripcion = get_field('breve_descripcion');
list($exposicion_fecha_inicio,$exposicion_fecha_fin,$exposicion_hora) = array_fechas_cdm(get_field('fecha_inicio'),get_field('fecha_fin'));
$visita_virtual = get_field('visita_virtual');
?>
//Code HTML
.
.
.
.
//End Code HTML
<?php
endwhile;
?>
</div>