WordPressでプラグインを使わずにカテゴリー別に記事を取得する方法と全ての記事を取得する方法をメモ。 WordPressでカテゴリー別に記事を取得する カテゴリー別に記事を取得する方法は以下のコードになります。 <ul> <?php $args = array( 'numberposts' => 'all','category' => 1, 'orderby' => 'desc'); $rand_posts = get_posts( $args ); foreach( $rand_posts as $post ) : ?> <li> <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a> </li> <?php endforeach; ?> </ul> 最初