ACF is a third-party plugin and I don’t know what functions it gives you that you could use.
In general, though, you can create a query for posts with a particular custom field and value.
$args = array(
'meta_key' => 'featured', // must match the key that ACF has used
'meta_value' => true, // must match the value that ACF has used
'post_type' => 'product' // must match your post type
);
$the_query = new WP_Query( $args );
Then just run through a secondary loop as normal:
if ( $the_query->have_posts() ) {
while ( $the_query->have_posts() ) {
$the_query->the_post();
// output html for each post here
}
/* Restore original Post Data */
wp_reset_postdata();
} else {
// no posts found
}
Depending on what you want you could put this into your front-page.php
template, hook it into the_content
or turn it into a shortcode.