0
votes
0answers
18 views

Re-order posts inside tax query

I have some posts having some custom fields and their value. I have custom fields like featured and expiry_date, whose values are yes/no and some date respectively. All these posts are coming under ...
0
votes
0answers
20 views

Is it possible to order a query on one taxonomy term by the terms in another, connected taxonomy?

I've seen the negative answer in this question, Using wp_query is it possible to orderby taxonomy?, but I think I have a valid use case for something similar that's less broad than in that previous ...
0
votes
1answer
60 views

Pre_Get_Posts order DESC not registering

I've created a filter function to filter a post type items by it's meta value _item_price. The problem is that it only works in Ascending Order and I'm not sure why. My pre_get_posts function looks ...
0
votes
2answers
192 views

WordPress Screwing Up 'orderby' => 'meta_value_num' in 'pre_get_posts'

I have a bunch of _ai_price_int meta values set up as just numbers. This is how the table looks: meta_id, post_id, meta_key, meta_value 1309, 1111, _ai_price_int, 6550 1310, 1115, ...
1
vote
2answers
875 views

WP_Query orderby post__in remains ineffective in the Loop [closed]

I’m trying to query a custom array of posts for the homepage, trying to maintain the order given in the array. To a certain degree this works fine, WordPress finds the posts, but in the Loop the order ...
1
vote
2answers
140 views

orderby meta_value breaks taxonomy term archives

I have a People post type with a Person Type taxonomy (e.g. "Staff"). On the Person Type Term Archive pages, I want to sort by a "Sort Name" custom field. To do so, I'm using a pre_get_posts call: ...
0
votes
0answers
48 views

How to order posts by parents?

I wanted to order my post type archive by its parents (like page list in wp-admin). This is what i have tried, but no luck so far. add_action( 'pre_get_posts', 'budget_archive_data' ); function ...
6
votes
6answers
2k views

Sort on meta value but include posts that don't have one

I've been modifying the built in WP search using the pre_get_posts filter, allowing the user to sort the posts (including a bunch of custom post types) by different fields. The problem I'm having ...
2
votes
1answer
441 views

Order posts by (hierarchical custom) taxonomy terms and term children

The scenario a custom post type wiki a (hierarchical) custom taxonomy topics a page template archive-wiki.php The situation Posts show up and get ordered by post_date (which is the default). The ...
0
votes
2answers
557 views

Check post_date in pre_get_posts

I want to change the order of a feed using pre_get_posts filter. But I want to exclude dates older than today. I see how one could do that if the date were in a meta key, but the date is in ...
1
vote
1answer
2k views

How to alter query order direction using $query->set('order', 'ASC'); inside a pre_get_posts filter?

According to: http://codex.wordpress.org/Class_Reference/WP_Query#Order_.26_Orderby_Parameters Default order is DESC and default orderby is date. In a custom plugin, plugin is applying the following ...