Calling Specific Pages with wp query Part II

Two issues here

  • The default page post type is page, not pages

  • Your meta_query is wrong, it should be an array of an array, not just an array

Your arguments should be

$args = array(
    'post_type'      => 'page',
    'order'          => 'ASC',
    'posts_per_page' => 50,
    'meta_query'     => array(
        array(
            'key'     => 'field_5505a81b83234', // field key generated from acf plugin
            'value'   => 'Yes'
        ),
    ),
);

Leave a Comment