So, I’ve created my own Sports tracking on the backend with ACF-Pro and I need to display all of the scores for a given team, in a given sports, during a given season.
I can’t get my meta-query to show scores for all games (home and away), only home or away depending on the order of my query:
'meta_query' => array (
'relation' => 'OR',
array ( 'key' => 'game_home_team', 'value' => $team_id ),
array ( 'key' => 'game_away_team', 'value' => $team_id )
'relation' => 'AND',
array ( 'key' => 'game_season', 'value' => $season ),
array ( 'key' => 'game_sport', 'value' => $sport )
With this code, only away games are shown. If I swap the OR arrays around to put away first, then only home games are shown.
I could use some help, or a link to something that better explains advanced meta-queries in WordPress because I’m confused.