Special Layout for one Category

I want to set up a template specifically for the Growing a Website category, which shows items in date order (oldest first) rather than reverse date order (newest first).

First, I need to create a category template with the name category-n.php (where n is the numeric id of the particular category, found by looking at the Categories, within Admin).  It’s probably easiest to copy category.php to start with. I’ve done that, and checked that my category is definitely using this template.

Now, to modify it to provide the different layout that I want, it seems important to understand The Loop.  It also seems important to understand the WordPress functions

After some searching and false starts, I found one function which appeared to do, quite simply, what I wanted – queryposts().  And, when I used the Default theme, adding the simple line

query_posts($query_string . “&order=ASC”);

immediately after the get_header() function, I achieved exactly what I wanted – have a look at the Growing a Website category now.  However, it’s interesting to note that it did not seem to have the desired effect when I was using my previous theme.  I think I need to understand just how my theme varies from the default one (and it clearly does, because each template includes a large chunk of header code, rather than calling get_header(). However I don’t see how that should affect the working of query_posts)….

I may have to make the default theme my basis for all work and just incorporate changes to look and function inspired by the other themes

More to come, once I understand what is happening….

WP Feedback

Dive straight into the feedback!
Login below and you can start commenting using your own user instantly