Instead of query_posts()
, use WP_Query()
:
function shortcode_eventi() {
$loop = new WP_Query(array(
'post_type' => 'eventi'
));
?>
<?php if ($loop->have_posts()) : ?>
<?php while ($loop->have_posts()) : $loop->the_post(); ?>
<small><?php the_time('F jS, Y') ?></small>
<?php endwhile; ?>
<?php else : ?>
<h2 class="center">Not Found</h2>
<p class="center"><?php _e("Sorry, but you are looking for something that isn't here."); ?></p>
<?php endif; ?>
<?php
}