Rouge posts when reorder archive page depending on category
-
Hello all,
I am in the process of updating a site that uses custom post types to display exhibitions, which are separated into 3 categories. Upcoming, Current and Past. The previous version of this site used CustomPress to create the post types, so that’s what I’m stuck using
Depending on whether the archive page is displaying upcoming or past exhibitions, the layout and order of posts are different. i.e. Upcoming exhibitions are order by date ascending and Past exhibitions order ordered by date descending.
To accomplish this I am first filtering the posts depending on category.
global $wp_query; $tag = $wp_query->get_queried_object(); $current_tag = $tag->term_id; if ( $current_tag == '8') { ......display posts of certain category ..... } elseif ( $current_tag == '9') { ..... display posts from other catgegory ..... }
That works fine, I then use the following to order the exhibitions by date, which also works fine “sort of”.
query_posts( array( 'post_type' => 'news', 'orderby' => meta_value, 'meta_key' => 'ct_Event_Date_datepicker_c4e9', 'order' => 'ASC' ) );
The issue is if a Past Exhibition is edited, it is then added to the future exhibitions instead of just the Past exhibitions page, hence calling them rouge posts. If I try and reset the exhibition category is it still displayed in the future category.
I tried adding variations of
'where' => meta_value, 'meta_key' => 'ct_Exhibition_radio_2cda', 'ct_Exhibition_radio_2cda' == 'Future Exhibitions'
into the query_post to try and filter it in the reordering query with out any luck.
Any help or direction would be a great help.
Thanks in advance.
D
- The topic ‘Rouge posts when reorder archive page depending on category’ is closed to new replies.