Title: Display attribute terms using a variable
Last modified: August 21, 2016

---

# Display attribute terms using a variable

 *  [valoros](https://wordpress.org/support/users/valoros/)
 * (@valoros)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/display-attribute-terms-using-a-variable/)
 * I’m trying to display the name and description for each attribute assigned to
   a given product. I guess the code would have to use $product->get_attributes();
   and then I would like to use the name and description for each of the terms it
   finds as a variable which I can echo.
 * I can get it working for a single attribute called ‘arsenalho’ using the following
   code:
 * <?php $customepattributes = get_the_terms( $product->id, ‘pa_arsenalho’);
    foreach(
   $customepattributes as $customepattributes ) { echo $customepattributes->name;
   echo ““; echo $customepattributes->description; } ?>
 * How can I ‘get’ the value ‘pa_arsenalho’ and place it into a variable?
 * [http://wordpress.org/plugins/woocommerce/](http://wordpress.org/plugins/woocommerce/)

The topic ‘Display attribute terms using a variable’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce/assets/icon.svg?rev=3234504)
 * [WooCommerce](https://wordpress.org/plugins/woocommerce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce/reviews/)

## Tags

 * [attribute](https://wordpress.org/support/topic-tag/attribute/)
 * [description](https://wordpress.org/support/topic-tag/description/)
 * [name](https://wordpress.org/support/topic-tag/name/)
 * [terms](https://wordpress.org/support/topic-tag/terms/)

 * 0 replies
 * 1 participant
 * Last reply from: [valoros](https://wordpress.org/support/users/valoros/)
 * Last activity: [12 years, 9 months ago](https://wordpress.org/support/topic/display-attribute-terms-using-a-variable/)
 * Status: not resolved