Why I can’t get the content of a post?

My code :

<div class="date"><?php the_time('d') ?> <?php the_time('M') ?></div>
<h2 class="titolo" style="min-height:0;"><?php the_title(); ?></h2>                                                                        
<div class="descrizione"><?php the_content(); ?></div>

time and title are correct. But the content is empty?

Read More

In fact, trying :

$pr=get_posts();
print_r($pr);

I see both title and description inside the array. Where am I wrong?

Related posts

Leave a Reply

2 comments

  1. try this

    <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    <div class="date"><?php the_time('d') ?> <?php the_time('M') ?></div>
    <h2 class="titolo" style="min-height:0;"><?php the_title(); ?></h2>                                                                        
    <div class="descrizione"><?php the_content(); ?></div>
    <?php endwhile; else: ?>
    <div class="alert alert-warning"><h4>Warning</h4><p><?php _e('Sorry, no posts matched your criteria.'); ?></p></div>
    <?php endif; ?>