Call a Taxonomy as a variable (2 posts)

  1. valoros
    Posted 2 years ago #

    I'm trying to call a Taxonomy from a template i have created. The issue is there are many taxonomies all linked to existing pages. I need to display the description of the taxonomy depending on which page is viewed.

    I can make this work if I specifically name the taxonomy, but I need it to work based on a variable. Can anyone help?

    The code i'm trying to use:

    $customepattributes = get_the_terms( $product->id, $taxonomy);
          foreach ( $customepattributes as $customepattributes ) {
              echo "<b>".$customepattributes->name."</b>";
              echo $customepattributes->description;
  2. Robin W
    Posted 2 years ago #

    you're missing a closing '}'

    not sure that's your problem, but won't help

Topic Closed

This topic has been closed to new replies.

About this Topic