0
votes
1answer
21 views

Posts with no meta field do not appear when sorting by meta field

I want to order my posts by a custom meta field "fieldA". I am using the following code: $query->set( 'meta_key', 'fieldA); $query->set( 'orderby', 'meta_value_num' ); $query->set( 'order', ...
2
votes
1answer
64 views

How to make orderby 'meta_value_num' OPTIONAL?

$args = array( 'cat' => 5, 'posts_per_page' => 8, 'meta_key' => 'custom_sort_order', 'order' => 'ASC', 'orderby' => 'meta_value_num' ...
0
votes
0answers
20 views

How to sort post_meta in edit.php?

I have Custom Type cpt1 and Custom Fields cf1, when you use hook manage_cpt1-bien_sortable_columns, wordpress don't sort the post_meta ?
0
votes
3answers
121 views

Order by a meta fiel in query loop

I would like to sort my article from a category by a number added in a meta field. Here is the first step, I get the articles to display on the page. <?php $cat = get_post_meta( get_the_ID(), ...
0
votes
1answer
130 views

Sorting meta box values by start- and enddate and all dates in between

What I've been attempting to write is a function that will allow me to sort a list of WordPress posts by their meta values start date, end date and all dates in between. I've set up a custom metabox ...
3
votes
1answer
932 views

Auto sort the wp-admin post list by a meta key

I am using this following code in my functions file to hide and add some custom columns to my post-edit screen in wp-admin. I am now trying to get the post list to sort by a post meta field (last ...
1
vote
1answer
380 views

How do I sort a custom post type admin column using two meta keys?

I have created a custom post type along with custom columns. One of my columns displays a date range such as "12/05/2012 - 11:00 am to 12/15/2012 - 1:00 pm". This is a concatenated string using a ...
10
votes
5answers
2k views

Can the Next/Prev Post links be ordered by menu order or by a meta key?

I have a series of posts that are ordered by a meta_key value. They could also be arranged by menu order, if necessary. The next/prev post links (generated by next_post_link, previous_post_link, or ...
0
votes
2answers
692 views

Sort custom posts in archive by multiple values: date AND meta key

I have a post type and I want to sort posts in its archive according to two values: by a meta value called "artwork_year" which contains a 4 digit number (year) by post publish date what the query ...
1
vote
2answers
1k views

Wordpress Menu Disappears when $query->query_vars['meta_key'] is set

I've set some meta variables on my WP posts. I want to be able to sort by these variables, and everything is working great except when I sort by either "views" or "likes". When I sort by either of ...
0
votes
1answer
619 views

How can I sort my loop based on meta data, using a form?

I've created a custom post type called 'properties' with custom meta boxes of 'price' and 'rooms'. I have a custom loop-property-archive.php to display the properties. What I would love to have is a ...
0
votes
3answers
760 views

Sort taxonomy page alphabetically by meta rather than default post date

The user starts at a page showing posts of custom post type, "agent". Each post displayed shows a region/custom taxonomy it belongs to and links to a page that shows all posts in the region the user ...