Home › Forums › General Issues › Loading fields: two separate fields, loops not clearing query › Reply To: Loading fields: two separate fields, loops not clearing query
I got this to work by adding $post_id to the get_field() function. And I needed to get the slug from the category object and not the name:
$sport = get_the_category();
$cat = $sport[0]->name;
$away_team = get_field('away_team_2',$post_id)->ID;
$home_team = get_field('home_team_2',$post_id)->ID;
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!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.