acf wordpress loop through and display blog posts order by date and type

Solutions on MaxInterview for acf wordpress loop through and display blog posts order by date and type by the best coders in the world

showing results for - "acf wordpress loop through and display blog posts order by date and type"
Amelie
17 Nov 2018
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(). ?>
Jessica
18 Feb 2020
1<?php 
2
3$posts = get_posts(array(
4	'posts_per_page'	=> -1,
5	'post_type'			=> 'post'
6));
7
8if( $posts ): ?>
9	
10	<ul>
11		
12	<?php foreach( $posts as $post ): 
13		
14		setup_postdata( $post );
15		
16		?>
17		<li>
18			<a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
19		</li>
20	
21	<?php endforeach; ?>
22	
23	</ul>
24	
25	<?php wp_reset_postdata(); ?>
26
27<?php endif; ?>
queries leading to this page
have posts get acfacf meta wueryacf query postsacf meta query by field nameget post by custom fieldacf get field guery from the post typequery posts by acf field valuefilter by post type field in acfcustom wordpress loop with acfacf custom fields meta keyacf meta field keysacf wordpress query filteracf post loopwp query get post by with acf fieldhow to display acf field from post type queryacf wp query with acf fieldacf meta nameacf data in custom post type loopacf add variable to wp queryacf user field meta queryacf wp querymeta query wordpress acfquery 3eset search custom fields pre get postacf meta query acf fieldmeta query acf fieldhow to post inside custom field get data in user add sectionacf meta query option pagewordpress filter posts by acf fieldacf insert field querywp query filter by acf fieldwp meta query acf fieldmeta query on acfacf meta field queryacf field in meta queryacf field meta queryacf value on meta field metadataacf get post by custom fieldacf query field betweenmeta query advanced custom fieldsacf wordpress loop through and display blog posts order by date and typeacf field meta query using post objectacf query posts by idacf query on meta querywordpress meta query acf fieldacf loop over all fields on postacf field meta key queryacf meta field query inacf custom post type loopmeta query by acf fieldacf with meta queryacf meta query number fieldmeta query in texonomy acf fieldacf query fieldmeta query with acf fieldacf meta query false fieldacf value on meta field meta querymeta query acfget post by acf fieldacf loop custom post typeqp query archive selectionhow to query in wordpress based on an acf fieldmeta query acf fieldquery posts by acf gallery fieldget custom post type posts with acf acf query post by custom fieldwordpress get posts acf meta fieldget posts return custom fieldacf filter custom fieldacf meta query numberacf meta query compare inacf meta queryacf looping through post typeswp query acf fieldacf loop postget acf from the post 28 29get acf from custom post loopacf get all posts with fieldquery acf field in user metawordpress filter posts by custom fieldacf meta query on int fieldwp query acf meta keyacf field as metadatahow to get post type 27s custom field in acfget posts custom fieldacf meta query falsegetpost with acf wordpressacf query posts arraywordpress query custom post type with acf fieldacf loop custom post typeswp query with acf fieldacf get field from custom post typecustom post search with acf fieldget cpt by acf fieldmeta query acf field true falseadvanced custom fields wordpress search query pre get postsget post acfhow to query post basedo n acf fieldquery acfacf wordpress loop through and display blog posts order by date and type