私のWordpress Index(index.php)ページでこのループを実行しています。これは問題なく投稿を表示します。Wordpressのクエリが非インデックスページで動作しないのはなぜですか?
しかし、このコードを別のページで使用しようとすると、投稿が見つかりません。
誰でも理由を説明できますか?
Ta!
<?php
$args = array(
'post_type' => 'post',
);
$query = new WP_Query($args);
if ($query->have_posts()) :
// Start the Loop.
while (have_posts()) : the_post();
get_template_part('content', get_post_format());
endwhile;
// Previous/next post navigation.
twentyfourteen_paging_nav();
else :
get_template_part('content', 'none');
endif;
?>
このテンプレートの名前は何ですか? –