Linked Questions

22 votes
2 answers

How do you use orderby with meta_query in Wordpress 3.1?

Is it possible to order my list of custom posts, after filtering it with meta_query, by the meta data of my choice? For example, I have a custom post type called webinars. I am trying to list all ...
Jeff K.'s user avatar
  • 323
10 votes
2 answers

ORDER BY custom field value

Based on example here I'd like to modify the query $q = new WP_Query( array( 'meta_query' => array( ...
dkatwp's user avatar
  • 217
4 votes
5 answers

Custom taxonomy - custom sortable column

I've created custom taxonomy called 'cities' where you can add cities and added custom field ( radio button ) with 2 options: 'Yes' and 'No' ( never mind what that is ). Everythins is ok, I can get ...
mihajlo's user avatar
  • 61
6 votes
2 answers

How to order by post_status?

I'm using get_posts() like this: $posts = get_posts(array('orderby' => 'post_status')) which is not possible cause it's not in the allowed keys in the parse_orderby() method How to get around ...
Xaver's user avatar
  • 1,039
3 votes
1 answer

Order Posts by Taxonomy and Meta Value

It's possible to order posts by Meta Value. It's possible to order posts by more than one value. And thanks to the code below it's possible to order by taxonomy. But how can I alter the code below ...
Chris's user avatar
  • 153
5 votes
1 answer

How to List Events by Year and Month Using Advanced Custom Fields?

I have a custom post type "Kalender_item" with a custom Date Field (YYMMDD). I want to list all the posts on a page sorted by Year and Month. For example: November 2012 (all events that occure in ...
Mister Melotte's user avatar
2 votes
1 answer

How to update serialized post meta?

I have serialized post meta. And i want to update single meta key. It looks like this: In array: $kisiArray = array( 'option1' => 'foo', 'option2' => 'bar', 'option3' => 'apple', ...
wpdev's user avatar
  • 539
1 vote
2 answers

Sort posts by custom fields value using dropdown menu

I'm trying to sort my posts by a custom field value, called price. Only using numbers in the custom field value. I want that the visitors of the website can sort the posts on price by using a dropdown....
Doen Webontwerp's user avatar
0 votes
1 answer

Filter posts in pre_get_posts order by meta value date (desc or asc)

I am trying to order the post by a meta value but it is not working the right way. I store the date in the post meta value like this 01 December 2019 10:00. Now I want to sort the posts desc or asc ...
yfain's user avatar
  • 63
0 votes
2 answers

Order Posts in Custom Order

I am trying to create a custom way to order my new custom post type. Here is what I am envisioning: There would be a custom way to order posts in an entirely unique order for display (Number, ...
Michael's user avatar
  • 88
0 votes
1 answer

How to display sticky post always at the top (before regular post) in wordpress?

I am working on a wordpress code as shown below in which the modified post displays at the top. $temp_args = [ 'post_type' => array('current-channel', 'post', 'current-episodes'), '...
user5447339's user avatar
0 votes
1 answer

How to put orderby on a custom field in query_posts

I have the following query in my query_posts and want to add order by to this. Order by will be on another custom field and sorted by desc order. Here is my existing query. //show all active posts ...
Neha Chopra's user avatar