get_terms not working for one taxonomy
-
I created an archive template (archive-house.php) for my custom post type. The archive template looks like a grid of images. I coded a caption to echo the title of the house and the location of the house. The location is a taxonomy. It kind of works but the problem I am having is that it shows the same location for each post. Here is the code:
<figcaption> <?php $args = array('number' => '1',); $terms = get_terms('location', $args ); foreach( $terms as $term ){ echo get_the_title() , '</br> ', $term->name; } ?> </figcaption>
on my content-house.php the location shows up correctly – different location for each post.
please help – thanks
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘get_terms not working for one taxonomy’ is closed to new replies.