Inconsistent Code
-
Hi Again,
I cannot figure out why the date is only showing on the first (most recent) post in my “Latest Posts” list at the foot of the page:
https://www.rayah.org/rhemagarden/
Here’s the code
<div class="left"> <h2>Latest Posts</h2> <ul class="block"> <?php $myposts = get_posts('numberposts=5'); if ($myposts) : foreach ($myposts as $post) : setup_postdata($post); unset($categories); foreach (get_the_category() as $category) $categories[] = $category->cat_name;?> <li><a href="<?php the_permalink();?>"> <span><?php the_title(); ?></span> <em><?php the_date();?></em></a></li> <?php endforeach;?> <?php else : ?> <li>no entries</li> <?php endif;?> </ul> </div>
Any help appreciated ??
Nicole
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Inconsistent Code’ is closed to new replies.