Support

Account

Home Forums Front-end Issues How to output posts from different CPTs that have a specific ACF field set? Reply To: How to output posts from different CPTs that have a specific ACF field set?

  • Do all of these post types have a unique ACF field name (meta_key) that exists for these post types but does not exist for the other post types that you do not want to show?

    if the answer is yes

    
    $args = array(
      'post_type' => 'any',
      'meta_query' =>
         array(
           'key' => 'field_name',
           'compare' => 'EXISTS'
        )
      )
    );
    $my_query = new WP_Query($args);