WP_Queryでカテゴリ絞り込みを使うと効かない模様
以下のように「’ignore_sticky_posts’ => false」を付けるとうまくいきます。
$args = array(
'post_type' => 'post', // 投稿タイプ
'posts_per_page' => 10, // 表示件数
'ignore_sticky_posts' => false, // 先頭固定表示を有効にする
);
$the_query = new WP_Query( $args );
if ( $the_query->have_posts() ) {
while ( $the_query->have_posts() ) {
$the_query->the_post();
?>
<--- 記事の表示 -->
<?php
}
wp_reset_postdata();
} else {
// 記事が見つからない場合の処理
}