Code viewer: /miscellany/05/perpage.phps からpluginをダウンロード。perpage.phps→perpage.phpに修正し、pluginフォルダへアップロード。その時、ファイルを開いて以下の数字の部分を変更します。「home」がトップページに表示する記事数、categoryがカテゴリページに表示する記事数です。
今回のこのperpage.phpというプラグインは、テンプレート毎に表示する記事数を変更できるというもので、これをしないと例えばトップページで「5」記事表示にしてると、カテゴリページでも「5」記事しか表示されない、という風になるようです。
$posts_per['home'] = 10;
$posts_per['day'] = 10;
$posts_per['month'] = 999;
$posts_per['search'] = 10;
$posts_per['year'] = 999;
$posts_per['author'] = 999;
$posts_per['category'] = 999;
category.phpの本文エリアを以下のように編集。
<ul> <?php if ($posts) : foreach ($posts as $post) : start_wp(); ?> <li id=”catpost-<?php the_ID(); ?>”> <a href=”<?php the_permalink() ?>” rel=”bookmark” title=”Permanent Link: <?php the_title(); ?>”> <?php the_title(); ?></a></li> <?php endforeach; else: ?> </ul> <p><?php _e(’Sorry, no posts matched your criteria.’); ?></p> <?php endif; ?>
参考記事
![]() |
いま一番わかりやすい WordPress日本語版でブログサイト構築入門 高尾 司 |


RSS

Trackback URL
Social BookMarks
はてなブックマーク(Livedoorクリップ(
Buzzurl(
Trackbacks
Comments
Comment feed
Comment