Sorry, I meant how did you order it with the latest posts at the top. When I try to use the argument from the get post page on Wordpress it doesn’t work. Thanks.
Since lot of people asked me how i have made my archives page http://stylizedweb.com/archive/ i realized that they are not really familiar with page templates so i looked over the web for some tutorials and i really couldn't find good ones, so this tutorial will shortly explain how to do it.
If your Wordpress blog is getting bigger archive page is really good to have, and here you can list all your posts, months, weeks what ever you want. If you are using some free template look in the theme folder because you could already have it, if you don't here's how to make it.
1. Open your index.php page and save it as archive.php
2. Replace the original loop code with some of these examples (it starts with <?php while(have_posts()) : the_post(); ?> and ends with <?php endwhile; ?> so everything between that)
<?php while(have_posts()) : the_post(); ?> <h2><?php the_title(); ?></h2> <ul> <?php $myposts = get_posts('numberposts=100&offset=0'); foreach($myposts as $post) : ?> <li><?php the_time('d.m.y') ?> | <a href="<?php the_permalink(); ?>"><? php the_title(); ?></a></li> <? php endforeach; ?> </ul> <?php endwhile; ?>
This will list all posts like on http://stylizedweb.com/archive/ you can change offset (number to start from) etc, more on Wordpress codex about it http://codex.wordpress.org/Template_Tags/get_posts. This second code will list categories and month archives.
<?php while(have_posts()) : the_post(); ?> <h2><?php the_title(); ?></h2> <ul><?php wp_list_cats(’sort_column=name&optioncount=1′) ?></ul> <ul><?php wp_get_archives(’type=monthly&show_post_count=1′) ?></ul> <?php endwhile; ?>
3. Add this code at the top of your archive.php page
<?php /* Template Name: Archives Page */ ?>
4. Upload archive.php to your theme folder
5. Create a new page and Archives Page from the page templates

Of course if you don't like saving index file as archive you can start from the making a new page and adding all these things.
Sorry, I meant how did you order it with the latest posts at the top. When I try to use the argument from the get post page on Wordpress it doesn’t work. Thanks.
James
What do you mean ordered list? This is ul with simple text for dates, please explain
Hey
Can you tell me how your ordered your list? I’ve tried using the order argument for ordering the dates similar to yours but nothing seemed to work. Thanks for the help, but this little bit is driving me nuts.
Thanks for the tutorial. Just wanna know how could I create archive of pages instead of posts?
Yeah agree that this type of tut is fairly minimal on the web!
I had to find a theme and copy it for how to do it.
very useful, your archive page looks good, thanks
good tutorial, thanks!
Awesome! Just what i was looking for, thanks!
on April 14, 2008
try this before foreach
<?php $myposts= array_reverse($myposts, true); ?>