| Företag | Avstånd km | "; $dealerlist = array (); $the_query= new WP_Query($args); if ( $the_query->have_posts() ) { while ( $the_query->have_posts() ) { $the_query->the_post(); $location=get_field('position',get_the_id()); $gatuadress=get_field('gatuadress',get_the_id()); $postadress=get_field('postadress',get_the_id()); $telefon=get_field('telefon',get_the_id()); $webburl=get_field('webburl',get_the_id()); if ($postnr != ""){ $distance=distance($strPosLat,$strPosLng, $location['lat'],$location['lng'], "K"); } else { $distance=''; } $newdealer = array ( 'dealer_name' => get_the_title(), 'dealer_url' => $webburl, 'dealer_adress' => $gatuadress, 'dealer_postadress' => $postadress, 'dealer_distance' => $distance ); array_push($dealerlist, array ('dealer_name' => get_the_title(),'dealer_url' => $webburl,'dealer_adress' => $gatuadress,'dealer_postadress' => $postadress,'dealer_distance' => $distance)); //echo "
| ".get_the_title()." ".$gatuadress." ".$postadress." | ".$distance." |
| ".$dealerlist[$row]["dealer_name"]." ".$dealerlist[$row]["dealer_adress"]." ".$dealerlist[$row]["dealer_postadress"]." | ".$dealerlist[$row]["dealer_distance"]." |