Hi, as the title states, I am having trouble with the get_posts() function. I have the following set of code:
$args = array(
'posts_per_page' => -1,
'offset' => 0,
'Series' => $ser,
'post_type' => 'interviews',
'meta_key' => 'position',
'orderby' => 'meta_value_num',
'order' => 'DESC',
'post_status' => 'publish' );
$posts_array = get_posts($args);
This calls up an array of posts from the interviews custom post type, which are in a custom taxonomy called ‘Series’, and which are supposed to be ordered by a numeric custom field named “position”. All of the taxonomies, post types, and meta field names are spelled correctly. I quintuple-checked.
In short, it isn’t working. The posts are being called and displayed, but in the wrong order. If it’s any help, I use the Advanced Custom Fields plugin, and the code I am using is very similar to what they suggest for integrating their plugin with get_posts.
I doubt that plugin is the problem. Any help anybody can offer would be greatly appreciated.