I am getting an problem using the get_terms() function.

Basically use:

<?php
$terms = get_terms( 'location' );
print_r($terms);
?>

I recieve an assortment back:

Array ( [0] => stdClass Object ( [term_id] => 8 [name] => Aberdare [slug] => aberdare [term_group] => 0 [term_taxonomy_id] => 8 [taxonomy] => location [description] => [parent] => 7 [count] => 1 ) [1] => stdClass Object ( [term_id] => 10 [name] => Aberdeen [slug] => aberdeen [term_group] => 0 [term_taxonomy_id] => 10 [taxonomy] => location [description] => [parent] => 9 [count] => 14 ) [2] => stdClass Object ( [term_id] => 17 [name] => Aberdeenshire [slug] => aberdeenshire [term_group] => 0 [term_taxonomy_id] => 17 [taxonomy] => location [description] => [parent] => 9 [count] => 41 ) [3] => stdClass Object ( [term_id] => 1203 [name] => Aberdour [slug] => aberdour [term_group] => 0 [term_taxonomy_id] => 1203 [taxonomy] => location [description] => [parent] => 446 [count] => 1 );

But when I attempt and obtain the terms using the parent of of a variety of child_from the array returns empty.

<?php
$terms = get_terms( 'location', array('parent' => 9) );
print_r($terms);
?>

I recieve this:

Array ( )

Does anyone understand what i am doing wrong?

Thanks Pete

Ok I solved the problem.

Was a little strange really. My terms were added using a script while using wordpress_place_term function. After I visited the edit-tags.php?taxonomy=location page within the dashboard could only begin to see the top three terms within the list around the right, but I saw others in he term cloud around the left.

Then i went into among the terms and saved it plus they all made an appearance within the list around the right hands side and in my array.

I am speculating their must of been some kind of caching around the terms list also it needed me in order to save one with the dashboard to be able to begin to see the hierarchy.

An unusual one I have to admit.

Pete