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 am unable to get the Parent Taxonomy Terms here is the code i am writing

$myterms = get_terms( 'iqvis_event_category', array( 'parent' => 0 ) );
echo '<pre>'; 
print_r($myterms);
echo '</pre>';

What is the Reason is there any Syntax problem ? or the parent argument is not working?? because if i am not giving the parent argument its working and getting all the terms with their children.

share|improve this question
    
i don't see any problem with it. there's no syntax problem. include your results –  peteroak Aug 8 '12 at 10:47
    
its nothing all i have to do add another argument 'hide_empty' => 0 then it was returning everything –  PhpSeeker Aug 8 '12 at 10:50
    
@PhpSeeker if that solved your problem, add it as an answer –  Joseph Aug 8 '12 at 13:56
    
Added Already Joseph :) –  PhpSeeker Aug 9 '12 at 3:57
add comment

1 Answer

up vote 1 down vote accepted

I figured it out I just have to add another argument and then it was working fine:

$myterms = get_terms( 'iqvis_event_category', array( 'parent' => 0, 'hide_empty' => 0 ) );
echo '<pre>'; 
print_r($myterms);
echo '</pre>';
share|improve this answer
add comment

Your Answer

 
discard

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.