Query posts with custom term not ordering posts
-
After using wp_category_dropdown to create a jumplist of terms from a custom taxonomy, I am using query_posts to retrieve custom posts (jobs) based on the selected term id (job-category) in the GET vars…
// convert the term_id in the GET var to a slug for query_posts if($_GET['term_id']): $term = get_term_by( 'id', $_GET['term_id'], 'job-category'); if($term->slug){ query_posts( 'job-category='.$term->slug.'&post_status=publish&orderby=date&order=DESC' ); //display text below $filter_text = '<h3>Displaying Jobs in category: '.$term->name.'</h3>'; } else { query_posts( 'post_type=jobs&post_status=publish&orderby=date&order=DESC'); } else: // no queryvar set query_posts( 'post_type=jobs&post_status=publish&orderby=date&order=DESC'); endif;
The code works fine, except the problem I have is that the posts are not ordering by date, as specified. I even used the following code to check the query:
echo "Query:<pre>"; print_r($wp_query->query); echo "</pre>";
and it outputs the following:
job-category=administrative-clerical-support&post_status=publish&orderby=date&order=DESC
Anyone have any idea why this isn’t working, please, or if it is a bug in 3.0? I’m completely stumped…
Thanks!
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Query posts with custom term not ordering posts’ is closed to new replies.