Support

Account

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;