Quantcast
Channel: Multiple meta_key with get_pages - WordPress Development Stack Exchange
Viewing all articles
Browse latest Browse all 2

Multiple meta_key with get_pages

$
0
0

I currently have the following code where I filter by the page template;

$pages = get_pages( array(‘post_type’ => ‘page’,‘meta_key’ => ‘_wp_page_template’,‘meta_value’ => ‘unit.php’,‘hierarchical’ => 0) );

I would also like to sort by an ACF field so would need to add something like;

‘meta_key’  => ‘status’,‘orderby’   => ‘meta_value’,‘order’ => ‘DESC’

Is it possible to get both meta_key parts to work together?


Viewing all articles
Browse latest Browse all 2

Latest Images

Trending Articles





Latest Images