I have made a custom loop in WordPress and for some reason, the date is being skipped on random intervals, even though the other post content is getting pulled in successfully every time.
Any ideas, because it is completely baffling me!
For example, a list of posts and when the date is missing:
- Date
- Date
- No date
- Date
- Date
- No date
- Date
- No date
- No date
- No date
Here is the code, including all the loops:
<?php query_posts('category_name=News&posts_per_page=10'); ?>
<?php while (have_posts()) : the_post(); ?>
<article>
<div>
<p>PUBLISHED: <?php the_date(); ?></p>
<h4><a class="news_title_link" href="<?php the_permalink();?>"><?php the_title();?></a></h4>
<?php the_excerpt(); ?>
<br />
<a href="<?php the_permalink();?>">Read more</a>
</div>
<div>
<?php if ( function_exists( 'get_the_image' ) ) { get_the_image(array('default_size' => 'thumbnail','default_image' => '/wp-content/uploads/2010/06/default-thumb.jpg'));} ?>
</div>
</article>
<?php endwhile; ?>
<?php endif;?>