著者を指定して関連記事を表示する方法
<h2 class="author_head"><?php the_author(); ?>の投稿一覧</span></h2>
<?php
$args = array(
'author_name' => 'kawagoe_cafe',//著者名
'posts_per_page' => 10,
);
$the_query = new WP_Query($args);
?>
<?php if ($the_query->have_posts()) : ?>
<?php while ($the_query->have_posts()) : $the_query->the_post(); ?>
<!-- ここに記事コンテンツ -->
<div class="post">
<a href="<?php the_permalink(); ?>"><?php the_post_thumbnail('thumbnail'); ?></a>
<h3 class="title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
</div>
<?php endwhile; ?>
<?php else : ?>
<?php endif; wp_reset_postdata(); ?>