I’m trying to order a list of posts based on an ACF field number, i/e 1 first 2 second etc.
There is also a field to determine if the post is show, i/e This post show yes or no?
I’ve tried both the following.
$args = array(
'post_type' => array( 'page', 'news-articles', 'about-gorilla','involved' ),
'showposts' => 4,
'meta_key' => 'home_page',
'meta_value' => 'yes',
'orderby' => 'home_order',
'order' => 'ASC'
);
// args
$args = array(
'post_type' => array( 'page', 'news-articles', 'about-gorilla','involved' ),
'showposts' => 4,
'meta_query' => array(
'relation' => 'AND',
array(
'meta_key' => 'home_page',
'meta_value' => 'yes'
),
array(
'orderby' => 'home_order',
'order' => 'ASC'
)
)
);
The latter ignores the post type and lists all posts, the former works apart from seems to ignore the ”orderby’ => ‘home_order’,’
Any ideas?