I have a problem with query_posts orderby multiple ways. I have in Wordpress one category where I need display first posts with have a rank and after display all posts by title.
Below are working codes, that work well, but do not know how to connect these codes.
This code show me only posts with ranks, order by high ranks first
query_posts(array('cat' => $category->term_id, 'posts_per_page' => -1, 'orderby' => 'meta_value', 'meta_key' => '_bunyad_review_overall', 'paged' => ( get_query_var('paged') ? get_query_var('paged') : 1),));
This code show me all posts orderby title
query_posts(array('cat' => $category->term_id, 'posts_per_page' => -1, 'orderby' => title, 'order' => ASC, 'paged' => ( get_query_var('paged') ? get_query_var('paged') : 1),));
I need connect these codes and in second code exclude all posts with ranks, because first code will show these posts.
- Show posts with ranks, orderby high rank first
- Show all posts, orderby title, exlucde posts with ranks
All this display in one page!
query_posts
. You should either useWP_Query
orpre_get_posts
– Pieter Goosen Jun 9 '14 at 5:46