Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I added custom attributes to my products, and I would like to show one of these on the product loop page(loop/price.php). The attribue name is: "garan".

$garanvalues = get_the_terms( $product->id, 'pa_garan');

foreach ( $garanvalues as $garanvalue ) {
    echo $garanvalue->name;

I used the code above, but the var_dump output the following:

array(1) {   ["invalid_taxonomy"]=>   array(1) ..

I hope you know solution. Thank you very much!

share|improve this question
Just checking the obvious, did you global $product? –  helgatheviking May 25 '13 at 14:36
Post the code that registers the CPT, please. –  s_ha_dum Mar 6 at 22:44
add comment

1 Answer

If the taxonomy name is garan then use garan as parameter for get_the_terms function instead of pa_garan.

share|improve this answer
It didn't help. Any other suggestion? –  user25381 Feb 18 '13 at 12:14
Use $garanvalues = get_the_terms( $product->ID, 'pa_garan'); –  Vinod Dalvi Feb 18 '13 at 12:17
Please explain why that could solve the problem. –  toscho Feb 18 '13 at 12:50
Not helps. If you read my first post, you can see I used same method. –  user25381 Feb 18 '13 at 14:44
add comment

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.