WordPress勉強中です。WordPress 5.3を使用。
テキスト通りに進めていますが、アイキャッチ画像がオーバーフローしてしまいます。
修正箇所をお教えいただきたくお願い致します。
該当のソースコード
home.php
1<?php get_header(); ?> 2 3<main class="mycontainer"> 4 5 <div class="myposthead"> 6 <h1>最新情報</h1> 7 <p>RECENT</p> 8 </div> 9 10 <?php if(have_posts()): while(have_posts()): the_post(); ?> 11 12 <article <?php post_class(); ?>> 13 14 <?php if( has_post_thumbnail() ): ?> 15 <figure> 16 <?php the_post_thumbnail(); ?> 17 </figure> 18 <?php endif; ?> 19 20 <h2><?php the_title(); ?></h2> 21 22 </article> 23 24 <?php endwhile; endif; ?> 25 26</main> 27 28 <?php get_footer(); ?>
該当のソースコード
function.php
1<?php 2 3function mytheme_setup() { 4 5 // (C) のCSSを有効化 6 7add_theme_support( 'wp-block-styles' ); 8 9 // 縦横比を維持したレスポンシブを有効化 10 add_theme_support( 'responsive-embeds' ); 11 12 // (E) のCSSを有効化&エディタに読み込み 13 add_theme_support( 'editor-styles' ); 14 add_editor_style( 'editor-style.css' ); 15 16 // ページのタイトルを有効化 17 add_theme_support( 'title-tag' ); 18 19 // link、style、scriptのHTML5対応を有効化 20 add_theme_support( 'html5', array( 21 'style', 22 'script' 23 ) ); 24 25 // アイキャッチ画像を有効化 26 add_theme_support( 'post-thumbnails' ); 27 28} 29add_action( 'after_setup_theme', 'mytheme_setup' ); 30 31function mytheme_enqueue() { 32 33 // Google Fontsを読み込み 34 wp_enqueue_style( 35 'myfonts', 36 'https://fonts.googleapis.com/css2?family=Josefin+Sans:wght@300;700&display=swap', 37 array(), 38 null 39 ); 40 41 // Dashiconsを読み込み 42 wp_enqueue_style( 43 'dashicons' 44 ); 45 46 // (D) テーマのCSSを読み込み 47wp_enqueue_style( 48'mytheme-style', get_stylesheet_uri(), 49 array(), 50 filemtime(get_theme_file_path('style.css')) 51); 52 53} 54add_action( 'wp_enqueue_scripts', 'mytheme_enqueue' ); 55
試したこと
コードの見直しを数回行いました。

回答1件
あなたの回答
tips
プレビュー
下記のような回答は推奨されていません。
このような回答には修正を依頼しましょう。
また依頼した内容が修正された場合は、修正依頼を取り消すようにしましょう。