Warning: Undefined array key "postnr" in /home/allhyr/hoppborgsgruppen.hyrapopcornmaskin.se/dealer-list.php on line 5
Hoppborgsgruppen - hitta uthyrare
Ange postnr:
  

'uthyrare', 'posts_per_page' => -1, 'orderby'=>'title', 'order' => 'ASC' ); echo ""; $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 ""; } /* Restore original Post Data */ wp_reset_postdata(); function cmp(array $a, array $b) { if ($a['dealer_distance'] < $b['dealer_distance']) { return -1; } else if ($a['dealer_distance'] > $b['dealer_distance']) { return 1; } else { return 0; } } if ($postnr !=""){ usort($dealerlist, 'cmp'); } for ($row = 0; $row < count($dealerlist); $row++) { echo ""; } } ?>
FöretagAvstånd km
".get_the_title()."
".$gatuadress."
".$postadress."
".$distance."
".$dealerlist[$row]["dealer_name"]."
".$dealerlist[$row]["dealer_adress"]."
".$dealerlist[$row]["dealer_postadress"]."
".$dealerlist[$row]["dealer_distance"]."