Use get_object_taxonomies
to get all of the taxonomies registered to a particular post type.
Also, don’t use query_posts
for secondary queries. or ever, actually. Use WP_Query
.
$args = array(
'posts_per_page' => 1,
'post_type' => 'movies',
'orderby' => 'post_date',
'meta_key' => 'featured_movie',
'meta_compare' => '=',
'meta_value' => 1,
);
$movie = new WP_Query( $args );
if( $movie->have_posts() ){
while( $movie->have_posts() ){
$movie->the_post();
// your post template tags
the_title();
the_post_thumbnail('full-thumbnail');
// taxonomies/terms
if( $taxonomies = get_object_taxonomies( 'movies' ) ){
foreach( $taxonomies as $taxonomy ){
if( $terms = get_the_terms( $post->ID , $taxonomy ) ){
foreach( $terms as $term ){
echo '<li><a href="' . get_term_link( $term ) . '">' . $term->name . '</a></li>';
}
}
}
}
}
wp_reset_postdata();
}