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 have looked through the posts here that involve this same error, without any luck.

I have a Custom Post Type (Staff) and a custom taxonomy for it. Making Staff posts and assigning terms is working fine, but I'd like to list all of the Staff in groups based on the taxonomy terms. But the terms do not come through.

The Template File is here: http://pastie.org/4372363

The (relevant parts of the) functions.php file is here: http://pastie.org/4372367

Any reason why I wouldn't be able to do this?

The result looks like this:

<div class="content">
    <h2>Array</h2>
    <div class="profile">...</div>
    <div class="profile">...</div>
    <div class="profile">...</div>
    <div class="profile fourth">...</div>
    <div class="profile">...</div>
    <div class="profile">...</div>
    <h2>Array</h2>
    <div class="profile">...</div>
    <div class="profile">...</div>
    <div class="profile">...</div>
    <div class="profile fourth">...</div>
    <div class="profile">...</div>
    <div class="profile">...</div>
    <div class="clear"></div>
</div>

With the content of the array being another Array with one item in it, being the "Invalid Taxonomy" error (a string).

Thanks!

share|improve this question
add comment

1 Answer 1

up vote 0 down vote accepted

In your Template File, it looks like get_terms function is getting passed null data since the $taxonomies object is just an array of strings, not an array of objects. In other words, try changing:

$terms = get_terms( $taxonomy->name );

to

$terms = get_terms( $taxonomy );
share|improve this answer
    
Thanks!! Also, when printing the Term name, I needed to change it to the following: echo '<h2>' . $term->name . '</h2>'; –  Steve Meisner Aug 1 '12 at 18:27
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.