You’re probably better off doing the category.php file. I’m not sure whether category-79.php will work, or whether you need to save in the format category-slug.php…
Either way, make the separate category template file, and before the loop, call the query manually:
query_posts('cat=79&order=ASC');
The above should override the query defaults. You might have to add a few parameters to get the listing working precisely how you expect:
query_posts() in Codex
John
Thanks, John. First impression is that your suggestion worked perfectly. I went with category-slug.php, and reading the Codex article, I’m pretty sure that no other parameters are needed.
I appreciate the help.
Hopefully not LITERALLY category-slug.php — I meant replace ‘slug’ with whatever the slug of that category is. So if the cat slug is books, the file would be category-books.php. Sorry, should have been clearer about that.
😉 Thanks, but naming the template was the easy part.
I seem to have a problem with pagination with the new template.
This category has 7 posts, but where I display 6 posts per page, Page 2 of the category I’ve modified shows the same first 6 posts as Page 1 in the category rather than showing the 7th post as I’d expect.
I’m wondering whether I need to include get_query_var( 'paged' )
somewhere in there, but I’m not clear about the syntax for including that in the query I inserted into the new template….
No sleep till Brooklyn.
I finally figured out that I just needed to merge the original query array into the new parameter array, like so:
global $wp_query;
query_posts(
array_merge(
array('cat' => 79,
'order' => ASC),
$wp_query->query
)
);
Thanks to John and the Codex.
Nicely done, and you’re welcome.
In the interests of the portability of your theme, you might consider applying a variable for your cat number:
$cat = get_query_var(‘cat’); // Gets the current ID number for the category
And then making ‘cat’ => $cat instead. This will ensure that the query is being run in relation to the name of the category, rather than the ID.
J
Thank you. I think that’s a good suggestion, but I’m not sure I understand how to implement it here. :\