URLと違う記事(常に同じ)が表示される
-
初心者です。
テーマを自作しているのですが、index.phpに最新記事を表示させています。
タイトルにリンクを貼っているのですが、どの記事へのリンクをクリックしても
1番新しい記事が表示されています。
例えばhttp://localhost/2017/09/26/145756
http://localhost/2017/09/23/184516とリンクがあるのですが、同じ記事が表示されてしまいます。
Twenty〜などのテーマに変えると、問題なく動作するのですが、
どこが間違っているのかわかりません。
何が原因でしょうか?index.phpは以下のとおりです。
————————————-
<?php //最新の記事5件まで表示させる
query_posts(‘showposts=5’);
if (have_posts()) : while (have_posts()) : the_post(); ?><dl class=”post”>
<dt><?php get_template_part(‘profile’); //書いた人のアイコン ?></dt>
<dd class=”meta”>
” class=”caption”><?php the_title_attribute(); //the_permalink()でその記事のURLを取得 ?><br />
<span class=”date”><?php the_time(‘Y年n月d日H:i(D)’) ?></span>
<span class=”cat”><?php the_category(‘, ‘); ?></span>
<span class=”tag”><?php the_tags(‘ ‘); ?></span>
<span class=”author”><?php the_author(); ?></span>
<span class=”edit”><?php edit_post_link(‘編集’,'<div class=”edit”>’,'</div>’); ?></span>
</dd>
<dd class=”entory-content”>
<?php the_content(); ?>
</dd>
</dl><?php endwhile; else : ?>
<p><?php _e( ‘記事がありませんでした。’ ); ?></p>
<?php endif; ?>
- トピック「URLと違う記事(常に同じ)が表示される」には新たに返信することはできません。