Display a code snippet based on a taxonomy term I am trying to build a node file for a content type in Drupal 7.59. I have for example a field for a taxonomy term. There is only 2 terms Expert and Guest.
I want to display something on the node if this term reference choice is marked as Expert.

So I need to figure out how to write a line that checks for the value of the taxonomy term and then if it matches expert then it displays something but if it is guest it doesn't.

The field I have setup in my content type is:


Name of field: author type
Machine Name: field_author_type   
Field Type: Term reference


The root taxonomy term is Author Type and the two terms are Expert and Guest.
Does anyone know how to accomplish this? I hovered over the taxonomy term I wanted to reference and it was /taxonomy/term/57/ Is 57 the actual number or do I find it elsewhere?

So far I have this which is not much and it doesn't work so it is wrong. I am really sucky at php. 

&lt;?php if ($content['field_authors_type']-&gt;taxonomy[57]): ?&gt;
    Put what you want to display here
&lt;?php endif; ?&gt;
The value you're looking for would be stored like so

$content["field_authors_type"]["#items"][0]["tid"]


You could, if you wanted to be tidier, put this if statement in your theme's template.php in a template_preprocess_node or template_preprocess_page function (more on that here: https://api.drupal.org/api/drupal/modules%21node%21node.module/function/template_preprocess_node/7.x). 

You would store your boolean value $variables['author_is_expert'] and then in your node.tpl.php, you can just use if ($author_is_expert)