I'm trying to check the value of a field on my content type that is a list of taxonomy terms to see if it matches a specific taxonomy term, then if it does match, echo the description field of the taxonomy term I checked. Else, if it does not match, then nothing is to be printed out.
Here is the code I've been experimenting with, but thus far have been unsuccessful getting to work properly:
if ( isset($facil->field_facility_type['und']) &&
$facil->field_facility_type['und'][0]['value'] == "Hospital")) {
foreach ($facil->field_facility_type['und'] as $description ) {
echo '<span><p> Say something wild and crazy!</p>'.$description["value"].'</span>';
echo '<br/>';
}
}
I'm confused on how to get it to check the value of the field of taxonomy terms, of which the specific one I'm trying to target for this piece is one of about 15 different terms.