in your $args you can’t add multiple ‘meta_key’ => ‘…’, ‘meta_value’=>’…’ on the same level.
you will want to replace your
meta_value entry by a multiple array:
$args = array( 'some_args' => 'some value, 'meta_query' => array( array( 'key' => 'state', 'value' => 'Texas', ), array( 'Key' => 'city', 'value' => 'Houston' ), 'some_other_args' => 'some_value' );
This should get you the state of Texas and the city of Houston with all the other args you have defined.
you may want to use variable on your states and city value.
I haven’t tested this code so let me know how it goes.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
© 2022 Advanced Custom Fields.