Displaying posts on static page – date issue
-
Hi There,
I have a problem…
I have a static home page and on there I display 5 latest posts with the the date and then the amount of characters limited to 35. This works fine. However, if there are 2 or more posts entered on the same date, then the date is only shown next to the most recent post, but I actually want the date to be show on them all, regardless. Please help!
<div id=”home_latest_news”>
<h1>Latest News</h1>
<?php $my_query = new WP_Query(‘showposts=5’); ?>
<?php while ($my_query->have_posts()) : $my_query->the_post(); ?>
<div class=”news_entries”>
<div>“>
<?php the_date(‘d/m/y’);?>
– </div>
<div>“>
<?php $content = get_the_content();
$content = strip_tags($content);
echo substr($content, 0, 45);
?>
…</div>
</div>
<?php endwhile; ?>
</div>
- The topic ‘Displaying posts on static page – date issue’ is closed to new replies.