I have a variable $terms that contains:
Array (
[230] => stdClass Object (
[term_id] => 230
[name] => Executive Committee
[slug] => executive_committee
[term_group] => 0
[term_taxonomy_id] => 241
[taxonomy] => team_member_filter
[description] =>
[parent] => 0
[count] => 1
[object_id] => 1561
[filter] => raw
)
)
Each post contains this array, obviously the '230' key is different for each post. Inside of the default wordpress loop, i can print_r($terms) and it returns this array for every post. I need to echo the 'slug' value for each post. I can spit out the slug value by writing $terms[230]->slug, but of course this only returns the first instance. How do I return each posts 'slug' value in the loop?
Here's my loop:
<?php $args = array('post_type' => 'team-member','posts_per_page'=>-1,'order'=>'DESC','orderby'=>'date'); ?>
<?php query_posts($args); ?>
<?php $terms = get_the_terms(get_the_ID(), 'team_member_filter'); ?>
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<!-- Get the taxonomy -->
<?php print_r($terms[230]->slug); ?>
<?php endwhile; ?>
How do I replace the '230' so that I get the 'slug' value for each post.