親テーマのCSSを読み込まない
-
以下をURLを参考に子テーマを作成したのですが、
親テーマのCSSが反映されず、子テーマのCSSのみ反映されています。
色々調べた結果、解決方法が分からず投稿させて頂きました。■参考URL
────────────────────────────────
https://wpdocs.osdn.jp/%E5%AD%90%E3%83%86%E3%83%BC%E3%83%9E■バージョン
────────────────────────────────
WordPress:ver 4.9.5■ディレクトリ
────────────────────────────────
親テーマディレクトリ名:twentyfifteen
子テーマディレクトリ名:twentyfifteen_child■子テーマの style.css
────────────────────────────────/* Template:twentyfifteen Theme Name:TwentyFifteen-child */ body { background-color:#FF8800 ; }
■子テーマの function.php
────────────────────────────────<?php add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' ); function theme_enqueue_styles() { wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' ); wp_enqueue_style( 'child-style', get_stylesheet_directory_uri() . '/style.css', array('parent-style') ); } ?>
■その他
────────────────────────────────
親テーマ側が「style.css」のみでほぼ構成されていることは確認済み
子テーマの「style.css」の背景色のみ反映されているどうぞ、宜しくお願い致します。
6件の返信を表示中 - 1 - 6件目 (全6件中)
6件の返信を表示中 - 1 - 6件目 (全6件中)
- トピック「親テーマのCSSを読み込まない」には新たに返信することはできません。