Support

Account

Home Forums ACF PRO Query pages for use of a flexible content layout Reply To: Query pages for use of a flexible content layout

  • In the DB the flex field is stored as an array of layout names.

    
    $flex_field_name = 'name of your flex field here';
    $layout_name = "name of your layout here";
    $args = array(
      'post_type' => 'page',
      'posts_per_page' => -1,
      'meta_query' => array(
        array(
          'key' => flex_field_name,
          'value' => '"'.$layout_name.'"'
          'compare' => 'LIKE'
        )
      }
    );