WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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;
    var_dump($garanvalue);
}

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

closed as off-topic by Pieter Goosen, ialocin, kaiser Jun 30 '14 at 10:01

This question appears to be off-topic. The users who voted to close gave these specific reasons:

If this question can be reworded to fit the rules in the help center, please edit the 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 '14 at 22:44

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

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