That would most definitely be easier if you use a Post Object field rather than a relationship.
With a post object you’d need to do a query, for example on the state page, to get all the counties
// assuming this is on the single state template // $post->ID represents the id for the state post // this only works with a Post Object field $args = array( 'post_type' => 'county', 'posts_per_page' => -1, 'meta_query' => array( 'key' => 'state', 'value' => $post-ID, ), ) $query = new WP_Query($args);
see WP_Query http://codex.wordpress.org/Class_Reference/WP_Query
for using a relationship field Eliot has a tutorial here http://www.advancedcustomfields.com/resources/querying-relationship-fields/
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.