フォーラムへの返信

2件の返信を表示中 - 1 - 2件目 (全2件中)
  • フォーラム: テーマ
    返信が含まれるトピック: ヘッダー画像のサイズを変更したい

    フロントページの画像の大きさを変えることができました。

    スタイルシートのみの変更です。
    (高さ設定は一例です。)

    .has-header-image.twentyseventeen-front-page .custom-header,
    .has-header-video.twentyseventeen-front-page .custom-header,
    .has-header-image.home.blog .custom-header,
    .has-header-video.home.blog .custom-header {
    height: 50vh; /* 75vh */
    }
    .has-header-image .custom-header-media img,
    .has-header-video .custom-header-media video,
    .has-header-video .custom-header-media iframe {
    position: absolute; /* fixed */
    }

    @media screen and (min-width: 48em) {
    .has-header-image.twentyseventeen-front-page .custom-header,
    .has-header-video.twentyseventeen-front-page .custom-header,
    .has-header-image.home.blog .custom-header,
    .has-header-video.home.blog .custom-header {
    height: auto;
    }
    .twentyseventeen-front-page.has-header-image .custom-header-media,
    .twentyseventeen-front-page.has-header-video .custom-header-media,
    .home.blog.has-header-image .custom-header-media,
    .home.blog.has-header-video .custom-header-media {
    height: 75vh; /* 100vh */
    }
    }

    フォーラム: テーマ
    返信が含まれるトピック: ヘッダー画像のサイズを変更したい

    フロントページの画像の大きさを他のページと同じにするのが簡単ではないでしょうか?

    フロントページの画像は body class の twentyseventeen-front-page と home で設定されていますので、この二つを削除すれば、他のページと同じ大きさになります。

    functions.php 内に次を設定してはいかがでしょうか?

    // Eliminate twentyseventeen-front-page home css
    add_filter( ‘body_class’, ‘my_body_class’,20 );
    function my_body_class( $classes ) {
    unset($classes[array_search(“twentyseventeen-front-page”,$classes)]);
    unset($classes[array_search(“home”,$classes)]);
    return $classes;
    }

    (注:フロントページの記事の上部に大きなスペースが発生しますので、個別でそのスペースを調整する必要がありますが。)

2件の返信を表示中 - 1 - 2件目 (全2件中)