2013年06月30日 追記・変更

記事ページで所属する記事を表示する事で、ユーザビリティ向上

記述内容
<?php $catlist = get_the_category(); //2つ以上の記事が存在する場合のみ表示する if(($catlist[0]->count) > 1 ): ?> <h2><?php $catlist = $catlist[0]; { echo $catlist->cat_name; } ?>の記事一覧</h2> <?php $posts = get_posts('&orderby=title&order=ASC&numberposts=0&exclude='.get_the_ID().'&category='.$catlist[0]->term_id); if($posts): foreach($posts as $post) : setup_postdata($post); ?> <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a><br /> <?php endforeach; endif; ?> <?php endif; ?>上記は、get_posts('この部分の引数で、出力の仕方を決めている') orderby=title は、タイトル名で並び替えを行う指定。 order=ASC で、順序を昇順にしている。
※降順はDESC numberposts=0 は表示記事数。0にすると全表示。
また、引数内の条件を&で繋げている。