###解決したいこと
wordpressウィジェットのカテゴリーとタグをクリックしても投稿記事一覧に反映されず、最初に表示されたページがそのまま表示されてしまっています。
例えば、カテゴリー名「html」をクリックしても、「html」のカテゴリー名がついた記事がまとまって表示されない。
タグも同じ症状が出ています。
###index.php
<?php query_posts('posts_per_page=5'); ?><!--indexの表示記事数--> <?php if(have_posts()):while(have_posts()):the_post(); ?><!--ループ開始--> <div class="page-title"> <a class="link" href="<?php echo get_permalink(); ?>"><?php the_title(); ?></a><!--the_title(); 記事タイトルを表示--><!--the_permalink(); 記事タイトルから記事へのリンク--> </div><!--/.page-title--> <div class="category"> <i class="fa fa-tag" aria-hidden="true"> </i><?php the_category(',') ?><!--カテゴリーを表示--> </div><!--/.category--> <div class="date"> <?php the_time('Y/m/d(D) H:i'); ?><!--投稿日時を表示--> </div><!--/.date--> <div class="page"> <?php echo mb_substr($post->post_content,0,140).'...'; ?><!--記事本文を出力し140文字に制限する--> </div><!--/.page--> <div class="border"></div> <?php endwhile; endif; ?><!--ループ終了-->
###functions.php
<?php if (function_exists('register_sidebar')) { register_sidebar(array( 'before_widget' => '<div>', 'after_widget' => '</div>', 'before_title' => '<h3>', 'after_title' => '</h3>' )); } ?>
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2016/10/25 10:41