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.
Related Posts:
- Order get_terms using a Custom Field
- Get value in custom field with taxonomy [closed]
- Remove Category description textarea
- Custom Taxonomy Images with Advanced Custom Fields
- Advanced custom fields – taxonomy terms images [closed]
- Displaying ACF image field [closed]
- Operations with custom fields values in a loop
- ACF vs Taxonomies
- Specifying a size when displaying an image associated with a taxonomy through ACF
- How to add contents of a custom field to a taxonomy term list?
- Search Tool only refreshes Page without showing results
- Display value of custom field of custom taxonomy in single post?
- How to fetch the data from Advanced Custom post when we search specific keyword or field name related to the post?
- WordPress implode & wp_insert_post question
- Website loading slowly – Advanced Custom Fields images
- Display a colour of custom taxonomy on the page
- Can’t get taxonomy ID for each post on archive page
- Loop to display ONLY custom taxonomy parent information [closed]
- Using Advanced Custom Fields Relationship Field to select a taxonomy term
- query to use to link to taxonomy single page
- Show related posts on single.php, grouped by taxonomy terms, with Advanced Custom Field post object selected
- Why do my quick edits for custom taxonomies not show on the post frontend?
- Echo ACF taxonomy field within a foreach for another taxonomy
- new custom filed not showing in taxonomy
- Connect ACF field + custom taxonomy [closed]
- Adding Advanced Custom Fields to posts
- ACF Field, hide taxonomy title and image when no nothing selected in post
- ACF Custom field not showing in Timber Taxonomy page
- WordPress search form and search result through ACF field in custom taxonomy
- Creating a list with multiple categoreis and options
- Taxonomies, Adanced Custom Fields and Repeatable Fields
- ACF Display Taxonomy Image Field
- Display posts from specific slug of the custom taxonomy in WordPress
- Gravity Forms with Advanced Post Creation Add-On not updating ACF fields on custom taxonomy
- ACF – How to get custom taxonomy term image field
- Add custom taxonomy fields when creating a new taxonomy
- get_term_by not working when in functions.php
- How to remove “Taxonomy name:” from wp_title
- Widget to display custom taxonomy tag cloud
- Custom Taxonomy Template not respecting ‘include_children’ => ‘false’
- Custom Taxonomy Relationship (ex: plant classification)
- register_rest_field for custom taxonomy fields that are assosiated with custom post type
- Help With issue on pre_get_posts filter in taxonomy
- get terms that have post with custom post type between 2 values
- How to display term description in empty terms archive?
- get_terms custom order
- Query Posts by taxonomy/Taxonomy Child Custom order
- 404 for a custom taxonomy?
- How to display featured images for all posts with certain taxonomy label?
- Adding Age Based WordPress Category
- Display direct children of the current custom taxonomy in taxonomy.php template
- get_posts of Custom Post Type AND Custom Taxonomy
- Can you filter wp_dropdown_categories with terms meta?
- one term two taxonomy’s?
- Page and Post return 404 with custom taxonomy
- Order by taxonomy Value [duplicate]
- Retrieving an intersection of two terms from two different custom taxonomies via API
- Category list with indent children list below current category
- Some custom taxonomy child terms not showing in admin. Caching problem?
- Custom Taxonomy Query
- Pass taxanomy parameters to next_post_link()?
- Get all terms, including unchecked, or get the terms outside loop
- get_term_link not working
- My custom taxonomy page is leading in 404 page
- Show template part if part of term
- Different Taxonomy Values for Each Post
- List Top 5 taxonomy terms based on number of post
- Get list of taxonomies associated with users
- Taxonomy.php how to show post only in current taxonomy with wp_query?
- Include get_term_link inside search
- Shortcode to show the terms from the current post (custom post type & custom taxonomy)
- Taxonomies and subtaxonomies relations
- How to change Custom Permalink for Taxonomy? (remove the slashes from term-slug)
- Custom taxonomy if statement
- Hierarchical taxonomies in permalink cause 404 for sub term archive
- Best way to have one product in both rental and sale parent category
- How do I check to see if a specific child term has shared posts with another set of child terms within the same taxonomy?
- Output slugs to use as class names for every taxonomy a post is attached to
- Group & Sort Taxonomy terms by letter – Is there a better way?
- qtranslate-x problem with custom term description
- Custom Tax Archive of Parents Only?
- ‘Post_tag’ taxonomy tags don’t link to existing posts in CMS
- Sorting terms individually for each post
- Looking for suggestions on creating simple database (Help!!)
- Display list of custom taxonomies from a custom post type ordered by their parent
- WordPress hiding posts without content on custom taxonomy query. How to solve?
- get meta fields and taxonomy of any post type
- Custom taxonomy – query returns an error
- Change taxonomy of posts
- Getting grandchildren of a post with a specified custom taxonomy?
- Taxonomy Parameters in WP Query to get posts from two different taxonomies
- Update fields with post object and custom tax with wp_insert_post
- Can you orderby slug in a taxonomy archive page using WP_Query?
- Any way to make custom taxonomy field searchable?
- Select Custom Taxonomy from Theme Options
- Taxonomies starting with a hyphen (minus) to assign B.C. dates to a post
- Rewrite URL for a specific taxonomy [duplicate]
- Having trouble querying multiple custom taxonomies
- Custom taxonomy still using query URL after fixing error
- Is it possible to hide a Custom Taxonomy panel for only some posts based on a certain condition?