Working With “The Loop”

The Loop” is A WordPress term that refers to the process of displaying posts. The Loop processes each of the posts to be displayed on the current page and formats them according to how they match specified criteria within The Loop template tags.

Using query_posts() and/or WP_Query allows to you to alter The Loop query to display the exact posts you’re looking for, including taxonomy queries to display posts “tagged” by a certain taxonomy.

As of version 1.0.2, CPT-onomies works with taxonomy queries within The Loop.

FYI: If using the tax query, and querying by ID, a CPT-onomy term’s term ID is the same as it’s post ID.

Display ‘movies’ that include ‘Tom Hanks’ from the ‘actors’ CPT-onomy:


$args = array(
   'post_type' => 'movies',
   'tax_query' => array (
      array (
         'taxonomy' => 'actors',
         'field' => 'slug',
         'terms' => 'tom-hanks',
         'operator' => 'IN'
if ( have_posts() ) : ?>
   <?php while ( have_posts() ) : the_post(); ?>
      <li><a href="<?php the_permalink() ?>" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></li>
   <?php endwhile; ?>
<?php endif;


WordPress Codex

For more information, refer to the WordPress codex.