I have a taxonomy template that is returning the correct posts (actually a custom post type) but I want to alter the order in which the posts are displayed. However, nothing I’ve tried will change the order of the posts from chronological.
I’ve assumed that since the posts have already been returned then I should use ‘query_posts’ to alter the order of the posts. Accordingly, [based on the codex], I added the following before the loop on the template:
query_posts( $query_string . ‘&order=>ASC’);
Changing “ASC” to “DESC” produces no changes in the listing.
NOTE: The end result I want will be more complicated than this example but for the moment I can’t even get a simple sort like above to work.
I’ve also tried using this approach
<?php $sectionarg = array(
‘order’ => ‘ASC’,
But that completely destroys the original list of returned posts and replaces it with regular posts.
So it appears that to maintain the original query you have to use the first approach but how then do you sort the returned posts?
Any advice would be greatly appreciated.
- The topic ‘Sorting Custom Posts On Taxonomy Template’ is closed to new replies.