A lot of websites use it but suprisingly nobody tell us how to do it (right way).
I have few ideas but Im not sure if this was the most efficient way - Im not very good with loops (under a year of experience in programming).
Raw example:
Have lots of if
statements in foreach
or while
loop.
// All this inside loop - I've already got while loop for my multiple markers
global $post;
$veggie_type = get_post_meta($post->ID, 'veggie_type', true);
if($veggie_type == 'carrot') {
icon = marker_url_1;
}
else if($veggie_type == 'beet') {
icon = marker_url_2;
}
//etc like 10 if statements
Could anyone give me an advice or example?