UPDATE: Ok this should work, according to ACF’s documentation:
$args = array(
'posts_per_page' => -1,
'post_type' => 'page',
'meta_query' => array(
array(
'key' => 'feature_on_front_page',
'value' => 'featured',
'compare' => 'LIKE'
),
)
);
Your code works for me.
Can you see the feature_on_front_page
custom field when you view the page(s) in the WordPress admin area?
Or perhaps the problem lies in the do some stuff
section you’ve omitted?
Related Posts:
- Group posts by custom field
- How to Filter Posts by Custom Fields?
- Orderby is working with one query but not with other
- Get a list of posts with associated meta_value
- Order by empty custom field
- Conditional operator OR not working with custom fields
- WP ForLoop to compare meta information of posts to determine what post to display
- Query only displays one page_id
- display ACF repater field in archive page
- Problem with my loops
- Custom search (wp query by custom fields)
- Loop through multiple custom fields with increasing number
- How do I display posts with specific value in a custom field into my loop?
- Can wp_query return posts meta in a single request?
- Get post count of current loop when using multiple queries on one page
- compare meta_query in get_posts arguments
- Display products from specific category in shop page
- Function in array as arguments for WP_Query
- meta_query where value is equal to given value
- Order by meta_value_num DESC and meta_value ASC on WP 4.0
- Sort posts by custom taxonomy name
- WordPress altering my custom query, How to fix it?
- Looping through tabular data
- Show default content if custom WP_Query has no posts
- How to query ‘posts_per_page’ to display a different blog posts index template?
- Order by meta_key in custom post type doesn’t affect the query
- Display featured products through custom loop in WooCommerce 3 [closed]
- meta_query on a date range using an array of values
- Filtering posts by custom field value not working
- Multiple WP_Query loops with Pagination Not Working
- Order Posts by meta value AND published date
- WooCommerce Only OnSale Products Loop Snippet [closed]
- Apply CSS class to every second database record [closed]
- How to prevent writing duplicate loops?
- ACF – Get lowest & highest value from field
- Upcoming Event: How do I sort database by custom date field, but ignore past dates?
- wp_query add arguments using array_push if variable met
- Group WP_Query by meta_key date
- How To Fix WP Query Returns Results But Shouldn’t?
- Two near-identical custom field types – one works, the other doesn’t . What can cause this?
- WP_Query condition affects posts_per_page count
- Custom Search Not Consistent with Results
- Display both standard posts in a specific category along with a custom post type in a single loop?
- Adding multiple meta_key fields as orderby options to a WP Query via a function
- 1/3 of posts different class
- Two loops on archive page
- How to order posts by title after they have already been sorted by category
- meta_value_num not ordering all items
- WP Group posts by year(desc) > month(desc) > date(asc)
- Running main loop 2 times with conditional statement
- WordPress | Date not always appear [duplicate]
- Array as ‘key’ in WP_Query
- Is_single() conditional tag returns null in query
- WP Query – order posts by meta field first and then order the rest
- Adding a html class based on post count
- WP_Query Meta_key is text value and need to sort as numeric not working
- filter wp_query result with custom field values
- Posts in loop all show the same author when there are many authors
- Multiple Rows in a using wp_query
- If have posts a week old, display, else display a different loop
- Create a page template for “top rated posts” but show full content and not just a list
- Daily drip of posts – based on user ‘startData’ – ordered oldest to newest
- How to add tax_query to $args with concatenation
- How to split a post and intercalate elements from a loop
- How to create a widget like this?
- Hiding carousel indicators if there’s only one post
- add_query_arg to compare and display events from a certain date
- Does query_posts have an effect on get_the_category?
- Second loop pagination changes URL, not content
- WP Query get only 1 post (sticky, not sticky etc)
- WP_Query not returning correct result with meta_query parameter
- How do i create a custom post query when the meta value is an array?
- WP Query – grouping posts by same meta key, adding together values from another key
- Retrieve all custom field values of a specific custom field metakey as an array, inside WP_Query
- Show custom content when loop or wp query reaches specific time?
- Loop through array of pages
- Ajax buttons not working properly in WooCommerce when using wc_get_template_part
- Order 2 meta_queries differently in WP_Query?
- Order posts by title and custom field value?
- the_post_thumbnail and multiple WP_Query
- I have 3 categories, i want to display on a loop the last 3 of every category
- List users by Year of Birth using a foreach loop to dynamically populate years and data
- WP_Query doesn’t works inside loop
- Problem with custom WP_Query and underlying pagination/posts_per_page
- How to make a shortcode for my WP_Query Loop? [duplicate]
- View related categories in order of posts
- 2 Loops on one page – pagination of 2nd loop ignore array of excluded posts
- Sorting posts by meta values: 2 different orders
- WP_query for posts with same post type AND same post category
- How to solve this script problem in theme directory?
- Sorting Posts with meta value not working
- WP_Query for attachments without duplicating post_parent and displaying tagged image
- List ALL posts within last week from current category on category page
- loop through custom post types with meta data
- Using Query In Post Type Archives
- Multiple loops on index page with sticky post and pagination
- tax_query not working properly with get_posts
- the_excerpt() not working in custom archive
- Get posts by meta value except one post [closed]
- Woocommerce set loop_shop_columns to be 3 in the main shop page loop only and 4 otherwise