WordPressで運用しているクライアントさんのサイトのトップページに、画像サムネイル入りの新着記事一覧を作りました。 ネット上に意外と情報が少なくて手を焼いたので、メモしておきます。 こんな感じのコードを書きました。 [php] <?php query_posts(‘&posts_per_page=5’); if (have_posts()): while(have_posts()): the_post(); ?> <h2><a href="<?php the_permalink(); ?>" ><?php the_title(); ?></a></h2> <div class="list_day">[<?php echo get_the_date(‘Y年n月j日’); ?>]</div> <?php if (has_post_thumbnail()) { the_post_thumb
![WordPressでサムネイル入り新着記事一覧を作る](https://cdn-ak-scissors.b.st-hatena.com/image/square/cfb427ed94efe6d33a89d51f74b6cc27f672d8ec/height=288;version=1;width=512/https%3A%2F%2Fwww.wakatta-blog.com%2Fwp-content%2Fuploads%2F2014%2F05%2F8412626796_5bcb5d6b891.jpg)