I have registered a custom post type "Projects" and also registered a custom taxonomy for that Post Type called "Project Categories". On my home page I have a div in which I would like to list all projects and terms fro the "Project Categories" taxonomy. Currently, I am only able to get the lists of the terms. Can someone tell me why I am unable to get the terms to display. Currently, I have:
<div class="list-container"> <?php query_posts( array( 'post_type' => 'projects' ) ); if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li> <?php endwhile; endif; wp_reset_query(); ?> <?php $taxonomy = 'project_categories'; $tax_terms = get_terms($taxonomy); ?> <?php foreach ($tax_terms as $cat): ?> <li><?php $cat; ?></li> <?php endforeach; ?> </div><!--end list-container-->
Another question I have is, is it better to include the taxonomies inside or outside of the query_posts loop?