カテゴリーのページで投稿一覧をサイドバーに全部表示させたい。
-
WordPress3.0日本語版で、1ページの表示件数を10に設定したうえで、例えば開いた記事のページがWordPressというカテゴリーの場合、その投稿一覧をサイドバーに全部表示させたいと思い、以下のコードをjQテーマのsidebar.phpに書き足していますが、12件ある投稿が10件しか表示されません。
<div class="cate_li"> <h4>このカテゴリーの投稿一覧</h4> <?php $cat = get_the_category(); $cat = $cat[0]; $cat = $cat->cat_ID; $posts = get_posts("order=desc&category=$cat&numberposts="); ?> <?php foreach($posts as $post): ?> <li><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></li> <?php endforeach; ?> </div>
これを全部表示させるにはどうしたらいいでしょうか。
以下がsidebar.phpの全コードです。
<?php /* This code retrieves all our admin options. */ global $options; foreach ($options as $value) { if (get_settings( $value['id'] ) === FALSE) { $$value['id'] = $value['std']; } else { $$value['id'] = get_settings( $value['id'] ); } } ?> <div id="right"> <p id="toggle-all"><a href="#" id="toggle" class="hide-all">Toggle</a></p><br /><br /> <div class="cate_li"> <h4>このカテゴリーの投稿一覧</h4> <?php $cat = get_the_category(); $cat = $cat[0]; $cat = $cat->cat_ID; $posts = get_posts("order=desc&category=$cat&numberposts="); ?> <?php foreach($posts as $post): ?> <li><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></li> <?php endforeach; ?> </div> <div class="clearfix"></div> <!-- widget --> <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('sidebar_right') ) : ?> <div class="widget"> <h4><a href="#" title="Toggle" class="hide_widget">Categories</a></h4> <ul> <?php wp_list_categories('title_li=0&categorize=0'); ?> </ul> </div> <div class="widget"> <h4><a href="#" title="Toggle" class="hide_widget">Blogroll</a></h4> <ul> <?php wp_list_bookmarks('title_li=0&categorize=0'); ?> </ul> </div> <div class="widget"> <h4><a href="#" title="Toggle" class="hide_widget">Meta</a></h4> <ul> <?php wp_register(); ?> <li><?php wp_loginout(); ?></li> <li><a href="<?php bloginfo('rss2_url'); ?>" title="<?php _e('Syndicate this site using RSS'); ?>"><?php _e('<abbr title="Really Simple Syndication">RSS</abbr>'); ?></a></li> <li><a href="<?php bloginfo('comments_rss2_url'); ?>" title="<?php _e('The latest comments to all posts in RSS'); ?>"><?php _e('Comments <abbr title="Really Simple Syndication">RSS</abbr>'); ?></a></li> <?php wp_meta(); ?> </ul> </div> <?php endif; // endif widget ?> <div class="flickr"><!-- 追加 flickr feeder --> <p>Flickr tag:sky</p> <?php echo gluedideas_FlickrFeeder::displayFeed(); ?> </div> </div>
- トピック「カテゴリーのページで投稿一覧をサイドバーに全部表示させたい。」には新たに返信することはできません。