galeria virtual
Exibindo todos os eventos
‘post’,
‘posts_per_page’ => -1,
‘orderby’ => ‘date’,
‘order’ => ‘DESC’,
));
if ( $the_query->have_posts() ) :
echo ‘‘;
while ( $the_query->have_posts() ) : $the_query->the_post();
// Pega slugs das categorias do post para usar como classes CSS
$cats = get_the_category();
$class_cats = ”;
if ( $cats ) {
foreach ( $cats as $cat ) {
$class_cats .= ‘ category-‘ . esc_attr($cat->slug);
}
}
// Saída HTML de cada post
?>
‘;
wp_reset_postdata();
else :
echo ‘
Nenhum evento encontrado.
‘; endif; ?>