Skip to content

Instantly share code, notes, and snippets.

@frankyonnetti
Last active February 17, 2021 03:43
Show Gist options
  • Select an option

  • Save frankyonnetti/5944757 to your computer and use it in GitHub Desktop.

Select an option

Save frankyonnetti/5944757 to your computer and use it in GitHub Desktop.
Drupal 7 - taxonomy term names in nodes #drupal #d7 #taxonomy
<?php // http://drupal.org/node/224171
$nodeterms = array();
foreach($node->taxonomy as $nodeterm) {
$nodeterms[] = $nodeterm->name;
} if (in_array('TERM-NAME', $nodeterms)): ?>
Do something...
<?php endif; ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment