I am using the following code to dynamically display a city based on a custom field on a page. How do I configure this same functionality in widget logic? I see where I can configure a page and category but can I use custom field?
<?php $value = get_post_meta($post->ID, 'locations', true);
if($value == 'sarasota') {echo 'Sarasota';}
elseif($value == 'bradenton') {
echo 'Bradenton';
} elseif($value == 'naples') {echo 'Naples';}
else {echo 'Fort Myers';}
?>