コメントありがとうございます。relationにORを指定したら挙動が変わりましたが、出力されるのは二つあるうちの(投稿タイプ)後者のみです。どちらも出力させたいのですが。
<?php
$args = array(
'post_type' => array('info-nicchu', 'info-ja'),
'tax_query' => array(
'relation' => 'OR',
array(
'taxonomy' => 'info-course-category',
'field' => 'slug',
'terms' => 'jpcn',
),
array(
'taxonomy' => 'info-category',
'field' => 'slug',
'terms' => 'info',
),
),
'paged' => $paged,
'posts_per_page' => '5'
); ?>
<?php query_posts( $args ); ?>
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); /* ループ開始 */ ?>
<dl>
<dt><a href="<?php the_permalink(); ?>"><?php echo get_post_time('Y年m月d日'); ?></a></dt>
<dd><a href="<?php the_permalink(); ?>"><?php if(mb_strlen($post->post_title)>30) { $title= mb_substr($post->post_title,0,30) ; echo $title. … ;
} else {echo $post->post_title;}?></a></dd>
</dl>
<?php endwhile; ?>
<?php else : ?>
<dl>
<dt>記事がありません</dt>
<dd>表示する記事はありませんでした。</dd>
</dl>
<?php endif; ?>
<?php wp_reset_query(); // ループをリセット ?>
gatespace様
大変失礼しました。私のミスでした。(該当投稿を削除しており、それが原因で出力されてなかっただけでした)gatespace様のご指摘どおり、relationを指定することで解決出来ました。ありがとうございます。
一応、該当コードを再掲しておきます。
いつも本当にありがとうございます。
<?php
$args = array(
'post_type' => array('info-nicchu', 'info-ja'),
'tax_query' => array(
'relation' => 'OR',
array(
'taxonomy' => 'info-course-category',
'field' => 'slug',
'terms' => 'jpcn',
),
array(
'taxonomy' => 'info-category',
'field' => 'slug',
'terms' => 'info',
),
),
'paged' => $paged,
'posts_per_page' => '5'
); ?>