One hard fought battle, one small victory

by Cheryl Johnson, Bob Taylor Properties, Inc., Los Angeles, CA on July 10, 2009

This is a valuable line of code.  It cost me about 45 minutes.

The code is for use in a WordPress footer.  (Altho it could be used in a sidebar, too.)  It displays a list of blog posts, limited to 7; but in ascending order, with the oldest date at the top of the list.

<?php query_posts('showposts=7&order=ASC'); if (have_posts()) : ?>

The reason for needing to display a list with the oldest first has to do with creating a kind of chapters-in-a-book sequence...... but beyond that, it's a long story.

This post at BlogMum was the key:  http://blogmum.com/2009/04/how-to-list-oldest-posts-first/

Leave a Comment

Previous post:

Next post: