Support » Fixing WordPress » title, author, date list

  • Resolved fksr86

    (@fksr86)


    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)

Viewing 3 replies - 1 through 3 (of 3 total)
  • whooami

    (@whooami)


    Member


    <?php $posts_per_page = 5;
    require('path/to/wp-blog-header.php');
    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.

    whooami

    (@whooami)


    Member


    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!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘title, author, date list’ is closed to new replies.