このコードの操作方法は、「カテゴリ別の関連記事」のみを表示しますか? このコードは "single.php"内にあります 私はstackoverflowを実行しませんでしたが、解決策を見つけることができませんでした。誰でも助けてくれますか?WordPress(taxonomy)の関連記事カテゴリ
<?php
$postsPerPageq = 5;
$allargw = array(
'post_type' => 'audioplayer',
'posts_per_page' => $postsPerPageq,
'orderby' => 'title',
'order' => 'DESC',
'tax_query' => array(
array(
'taxonomy' => 'audiotop',
'field' => 'slug',
'terms' => 'top-audio'
)
)
);
$topaudio = new WP_Query($allargw);
while ($topaudio->have_posts()) : $topaudio->the_post();
?>
<h3><a href="<?php the_permalink(); ?>"><?php the_title();?></a></h3>
<?php endwhile; wp_reset_postdata();?>
これをチェックしてください: - http://wordpress.stackexchange.com/a/41273またはhttp://wordpress.stackexchange.com/questions/30039/how-to-display-related-posts-from-same-カテゴリ –