私のコードでは、posts_per_page(表示される投稿の数)の横にあるすべてが機能します。これが私のWordpressコードの一部です:
<?php
$category = get_the_category();
$current_category = $category[0]->term_id;
$qarr = array(
'posts_per_page' => $posts_number,
'cat' => $current_category,
'tag' => 'pinned', // tag filtered
'post__not_in' => array(get_the_ID())
);
$q = new WP_Query($qarr);
if($q->have_posts()) : while ($q->have_posts()) : $q->the_post();
?>
なぜ機能しないのですか?ドキュメントを読みましたが、問題が何であるかわかりません。
表示してテストする場合の完全なコードは次のとおりです。$posts_numberに番号を設定するだけです。http://pastebin.com/uNsynNiM