表示させたい固定ページのphpファイルを開いて編集
以下のコードをタグ名、取得件数や表示させるときのHTML構造を変更して貼り付けるだけです。
<?php
$tag = '取得したいタグ名'; // タグのスラッグを指定
$args = array(
'post_type' => 'post', // 投稿タイプを指定
'tag' => $tag, // タグを指定
'posts_per_page' => 4, // 取得する記事数を指定
);
$query = new WP_Query($args);
if ($query->have_posts()) :
while ($query->have_posts()) : $query->the_post();
// ここに記事を表示するためのコードを追加
?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header class="entry-header">
<h2 class="entry-title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
</header>
<div class="entry-content">
<?php the_excerpt(); ?>
</div>
</article>
<?php
endwhile;
wp_reset_postdata();
else :
// 記事が見つからない場合の表示
echo '該当する記事はありません。';
endif;
?>