Support » Fixing WordPress » title, author, date list
9 years, 4 months ago
Hi, i’m working on my home page right now.
I’d like to put a list of the last five posts on the site.
I’ve found a code on the wordpress codex called mini-loop. i’ve put it, but now i can’t do a list with the author and the date.
i want something like this:
1. (post title) by (author) on (date)
2. (post title) by (author) on (date)
3. (post title) by (author) on (date)
4. (post title) by (author) on (date)
5. (post title) by (author) on (date)
<?php $posts_per_page = 5;
if (have_posts()) : while (have_posts()) : the_post();
the_title(); ?> by <?php the_author(); ?> on <?php the_time('F j, Y');?><br />
<?php endwhile; else: ?>
<?php endif; ?>
You can also use query_posts if you dont want to use the posts_per_page variable.
oh, sorry! I didnt put that code inside an ordered list.. Im assuming you can figure that out.. 🙂
ya, i got it!
thanks a lot!