Hi I have a WordPress site with an array with elements in, and I when I loop through the array I want the fields to display in the order as it is set in the array. For example:
My array:
$metas = get_post_meta($post->ID);
$metatodisplay = array('address', 'county', 'postcode', 'region', 'telephone', 'fax', 'email', 'website', 'contact', 'cab_member_since', 'twitter', 'linkedin');
My foreach loop:
foreach($metas as $key=>$value){
if(in_array($key, $metatodisplay)){
echo $key;
}
}
I want the array values to display in the order as shown in the $metatodisplay
array. At this point they are just random on several pages, and on others they display correctly.