'AND');
$meta_query[] = array(
'key' => 'tipo',
'value' => $tipo,
'compare' => '='
);
if($anio){
$meta_query[] = array(
'key' => 'anio',
'value' => $anio,
'compare' => '='
);
}
$tax_query = array();
if($categoria){
$tax_query[] = array(
'taxonomy' => $tax_slug,
'field' => 'slug',
'terms' => $categoria
);
}
$args = array(
'post_type' => 'descargable',
'posts_per_page' => 6,
'paged' => $paged,
'meta_query' => $meta_query,
);
if(!empty($tax_query)){
$args['tax_query'] = $tax_query;
}
$query = new WP_Query($args);
ob_start();
echo '
'.$query->found_posts.' resultados encontrados
';
echo '';
if($query->have_posts()){
while($query->have_posts()){
$query->the_post();
$anio_field = get_field('anio');
$archivo = get_field('archivo');
?>
'.esc_html($anio_field).' | '; } ?>
PDF
No se encontraron resultados.';
}
echo '
';
// Generar paginación usando paginate_links()
$big = 999999999;
$pagination = paginate_links( array(
'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),
'format' => '?paged=%#%',
'current' => $paged,
'total' => $query->max_num_pages,
'prev_text' => __('Anterior', 'cimenta'),
'next_text' => __('Siguiente', 'cimenta'),
'type' => 'list'
) );
echo '';
$html = ob_get_clean();
wp_send_json_success($html);
}
// Favicon dinámico según el tema claro/oscuro del navegador
function agregar_favicon_svg() {
?>
esc_html__( 'Header menu', 'cimenta' ),
'menu-footer' => esc_html__( 'Footer menu', 'cimenta' ),
)
);
ob_start();