分類用語によるカスタム投稿タイプのクエリ
このサンプルでは、次のことを前提としています。
コード:
<?php query_posts( array( 'featured-vendors' => 'checked' ) ); ?>
<?php if( is_tax() ) {
global $wp_query;
$term = $wp_query->get_queried_object();
$title = $term->name;
} ?>
<div class="my-custom-post">
<h3><?php echo($title); ?></h3> //this will show the name of the post type
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<div class="entry"> <h3><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h3>
<?php the_excerpt(); ?> //shows the excerpt
</div><!--/end entry-->
</div><!--/end post-->
<?php endwhile; else: ?>
<p><?php _e('No Post Found','your_theme_text_domain'); ?></p>
<?php endif; ?>