Multiple meta_key with get_pages

I’m not sure if you can do it with get_pages(), but you should be able to do something like this with get_posts(): $args = array( ‘post_type’ => ‘page’, ‘meta_query’ => array( ‘template_clause’ => array( ‘key’ => ‘_wp_page_template’, ‘value’ => ‘unit.php’, ‘compare’ => ‘=’, ), ‘status_clause’ => array( ‘key’ => ‘status’, ‘compare’ => ‘EXISTS’, ), ‘relation’ … Read more

Get largest page id by title?

By using wp_query you can have more control: $title = “your title” $q = new WP_Query (array( ‘posts_per_page’ => 1, ‘title’ => $title, )); And then you can iterate through, but because we used posts per page 1 you’ll get only 1 item. By default wp query displays the last first by date, you can … Read more