acf meta field query

Solutions on MaxInterview for acf meta field query by the best coders in the world

showing results for - "acf meta field query"
Alejandro
24 Nov 2019
1$posts = get_posts(array(
2	'numberposts'	=> -1,
3	'post_type'		=> 'post',
4	'meta_query'	=> array(
5		'relation'		=> 'AND',
6		array(
7			'key'	 	=> 'color',
8			'value'	  	=> array('red', 'orange'),
9			'compare' 	=> 'IN',
10		),
11		array(
12			'key'	  	=> 'featured',
13			'value'	  	=> '1',
14			'compare' 	=> '=',
15		),
16	),
17));
18
19// args
20$args = array(
21	'numberposts'	=> -1,
22	'post_type'		=> 'event',
23	'meta_key'		=> 'location',
24	'meta_value'	=> 'Melbourne'
25);
26
27
28// query
29$the_query = new WP_Query( $args );
30
31?>
32<?php if( $the_query->have_posts() ): ?>
33	<ul>
34	<?php while( $the_query->have_posts() ) : $the_query->the_post(); ?>
35		<li>
36			<a href="<?php the_permalink(); ?>">
37				<img src="<?php the_field('event_thumbnail'); ?>" />
38				<?php the_title(); ?>
39			</a>
40		</li>
41	<?php endwhile; ?>
42	</ul>
43<?php endif; ?>
44
45<?php wp_reset_query();	 // Restore global post data stomped by the_post(). ?>
queries leading to this page
acf custom fields meta keyacf wordpress query filteracf meta query false fieldmeta query acfwp query acf meta keymeta query acf fieldmeta query acf field true falsemeta query advanced custom fieldshow to get post type 27s custom field in acfacf get field guery from the post typewp query acf fieldwordpress get posts acf meta fieldacf add variable to wp queryacf meta query option pagewp meta query acf fieldget post acfadvanced custom fields wordpress search query pre get postshow to post inside custom field get data in user add sectionhave posts get acfacf query field betweenhow to display acf field from post type queryacf wp query with acf fieldgetpost with acf wordpressacf query posts arrayacf query posts by idacf meta query number fieldacf filter custom fieldquery posts by acf field valuequery posts by acf gallery fieldacf insert field queryacf field meta key queryget post by acf fieldget posts return custom fieldacf user field meta queryacf value on meta field meta queryacf meta query numberacf field in meta queryacf meta field queryacf meta field query inmeta query in texonomy acf fieldacf meta query acf fieldwp query with acf fieldacf meta wueryacf query on meta queryget posts custom fieldacf meta field keysacf meta query on int fieldquery acf field in user metameta query with acf fieldacf value on meta field metadataacf wp queryget post by custom fieldacf query post by custom fieldacf get all posts with fieldmeta query wordpress acfquery acfhow to query post basedo n acf fieldfilter by post type field in acfwordpress query custom post type with acf fieldacf wordpress loop through and display blog posts order by date and typecustom post search with acf fieldacf query postsacf meta nameacf meta query compare inacf with meta queryacf query fieldmeta query acf fieldhow to query in wordpress based on an acf fieldget custom post type posts with acf meta query by acf fieldwordpress filter posts by custom fieldmeta query on acfget cpt by acf fieldwp query get post by with acf fieldquery 3eset search custom fields pre get postqp query archive selectionacf get post by custom fieldwordpress filter posts by acf fieldacf field as metadataacf meta query falseacf meta queryacf meta field query