Mostrar próximos eventos em widget sem usar plugin

Olá pessoal,

Para quem precisa mostrar os próximos eventos e não quer usar plugin. Basta criar um widget de texto e adicionar o seguinte código:

<div>
<?php
$ArtigosFuturos = new WP_Query('post_status=future&order=ASC&showposts=-2');
if ($ArtigosFuturos->have_posts()) {
while ($ArtigosFuturos->have_posts()) : $ArtigosFuturos->the_post();
$do_not_duplicate = $post->ID; ?>
<li><h4><strong><?php the_time('d-m-Y') ?> - </strong><?php the_title(); ?></h4>
<?php the_content(); ?>
<br></li>
<?php endwhile;
}

else {

echo "Nenhum evento programado";

}
?>
</div>

É isso aí galera, paz e feliz natal a todos

Pular para o conteúdo