投稿ページの右ナビなどに自分の所属するカテゴリーの投稿一覧を表示するとき、
自分の投稿タイトルを外しつつ、カテゴリー一覧を表示する方法
<?php $cat = get_the_category();$cat = $cat[0];{ $catid= "$cat->cat_ID"; } $myposts = get_posts('category='.$catid); foreach($myposts as $key=>$value){ if($post->ID == $value->ID){ unset($myposts[$key]); } } foreach($myposts as $post) :?> <li><a href="<?php the_permalink(); ?>"><?php the_title() ?></a></li> <?php endforeach; ?>