When your website means business.

ACF | Type: PHPQuery Posts with ACF Values (Basic)

Displaying posts that include a particular value for an ACF field (meta_key).

$posts = get_posts(array(
	'numberposts' => -1,
	'post_type' => 'event',
	'meta_key' => 'location',
	'meta_value' => 'melbourne'
if($posts) {
	echo '<ul>';
	foreach($posts as $post) {
		echo '<li><a href="' .get_permalink($post->ID). '">' .get_the_title($post->ID). '</a></li>';
	echo '</ul>;
We use cookies in order to give you the best possible experience on our website. By continuing to use this site, you agree to our use of cookies.
Cookies Notice