sort custom taxonomy archive
-
Would anyone know what code I can use to sort my custom taxonomy template by anything other than the defaults?
example:
I have set up a custom post type “type” and a custom taxonomy “year” which has sub-categories : 2001, 2002, 2003, 2004, 2004 etc.I have this code in the template head which grabs the taxonomy sub-category name
<?php global $wp_query; $term = $wp_query->get_queried_object(); $title = $term->name; ?>it’s pretty simple to display all “types” assigned to each year – it is just http://www.mysite.com/year/1995
Those posts are handled by the template taxonomy-year.php
But the posts arrive at the template and the order is still in the default post order – presumably postID.
They are displayed by the default loop
<?php if (have_posts()):while (have_posts()) : the_post(); ?>Have set up many custom meta fields I could sort by but as the posts already arrived at the template “queried” it doesn’t seem to make sense to “query” them yet again.
Can anyone help? I would rather not use plugins please.
The topic ‘sort custom taxonomy archive’ is closed to new replies.