Forums

Need help with the <?php get_archives ?> code (2 posts)

  1. leksi
    Member
    Posted 3 years ago #

    Hello. I have this line of code: <?php get_archives('postbypost','5', 'custom', '', '
    '); ?> that displays 5 of my recent posts... How do i modify it to display not only the "title" but the date, and maybe some "Read more" line in the end? Thanks for the help...

  2. esmi
    Theme Diva & Forum Moderator
    Posted 3 years ago #

    That's old code that should be replaced by wp_get_archives.

    But if you want a listing that includes the date and some content, you'd be better of using a Loop and adding:

    <?php
    $args= array(
    	'posts_per_page' => '5',
    	'ordeby' => 'date'
    );
    query_posts($args);
    ?>

    just above the start of the Loop.

    http://codex.wordpress.org/Template_Tags/query_posts

Topic Closed

This topic has been closed to new replies.

About this Topic