Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
カテゴリ33、39の両方のメンバーであり、ポストタイムアスリートである投稿のみを表示したいと思います。私の現在のコードは、カテゴリ33および39の投稿とアスリートを示しています。
<?php query_posts( 'cat=33&cat=39&post_type=athletes'); ?>
どのような調整が必要ですか?
クエリ文字列の代わりにオプションの配列を使用できます。このcategory__and設定を使用して、必要な操作を実行できます。
category__and
<?php query_posts(array( 'category__and' => array(33,39), 'post_type' => 'athletes' )); ?>