Linked Questions

21
votes
2answers
22k views

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 ...
1
vote
4answers
5k views

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 ...
6
votes
2answers
2k views

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 ...
3
votes
1answer
12k views

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 ...
4
votes
1answer
4k views

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 ...
1
vote
1answer
1k views

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', ...
1
vote
2answers
2k views

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....
0
votes
1answer
90 views

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 ...
0
votes
1answer
89 views

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'), '...
0
votes
2answers
45 views

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, ...
0
votes
1answer
30 views

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 ...