Simplicity2の子テーマで親テーマのCSSがうまく反映されない

自力でSimplicity2の子テーマを作ったときにうまくいかなかったときの話

Simplicity2はあらかじめ子テーマまで用意してくれている使いやすいテーマです。

そうは言っても、自分で子テーマを作りたい、という人もいるのでは?

詳しい子テーマの作り方はこちらをご参照ください。

目次 まえがき 必要スキル/環境 親テーマを追加 子テーマ準備  フォルダ作成  ファイル作成  ファイル圧縮  インストール 動作確認 おわりに ...

今回はわたしがSimplicity2の子テーマを自分で作った際に出た問題と対処方法をご紹介します。

現象

微妙に親テーマのCSSが反映されていない。

  • 基本的に親テーマの設定は有効である。
  • 親テーマでは、カスタマイズ画面ではメニューバーがレスポンシブ対応されているが子テーマではメニューバーとなっている。
  • 子テーマのstyle.cssで設定した色は有効である。

環境

WordPress 4.9.1
Simplicity2 2.6.3

解決策

まずは子テーマ化する上で、最初に作ったstyle.cssとfunctions.phpがこちら。

動きそうなんですけどね。

とりあえず何が悪いのかわかりませんでしたが、いろいろ試して解決した修正ソースが以下の通り。

親テーマのstyle.cssの読み込み順の指定の部分に、空のarray(”)を入れると解決!

ただし、cssの読み込み順を正確に指定しないと親テーマのcssが子テーマよりも後に読み込まれることもある模様。。

参考サイト

とりあえずこの設定で様子を見つつ、問題があったら、ちゃんと読み込み順を指定するようにしよう。

コメント

  1. … [Trackback]

    […] Find More on to that Topic: blog.pippuriric.com/wordpress/simplicity2-theme/ […]

  2. … [Trackback]

    […] Read More Information here on that Topic: blog.pippuriric.com/wordpress/simplicity2-theme/ […]

  3. Scarlett より:

    … [Trackback]

    […] Info to that Topic: blog.pippuriric.com/wordpress/simplicity2-theme/ […]

  4. … [Trackback]

    […] Information to that Topic: blog.pippuriric.com/wordpress/simplicity2-theme/ […]

  5. … [Trackback]

    […] Find More Info here on that Topic: blog.pippuriric.com/wordpress/simplicity2-theme/ […]

  6. … [Trackback]

    […] Find More on to that Topic: blog.pippuriric.com/wordpress/simplicity2-theme/ […]

  7. poker99 より:

    … [Trackback]

    […] Info on that Topic: blog.pippuriric.com/wordpress/simplicity2-theme/ […]

  8. … [Trackback]

    […] Find More to that Topic: blog.pippuriric.com/wordpress/simplicity2-theme/ […]

  9. Free JAV より:

    … [Trackback]

    […] Find More to that Topic: blog.pippuriric.com/wordpress/simplicity2-theme/ […]

  10. real estate より:

    … [Trackback]

    […] There you can find 43237 more Info on that Topic: blog.pippuriric.com/wordpress/simplicity2-theme/ […]

  11. 918kiss より:

    … [Trackback]

    […] Find More on to that Topic: blog.pippuriric.com/wordpress/simplicity2-theme/ […]

  12. Skrota bil より:

    … [Trackback]

    […] Info on that Topic: blog.pippuriric.com/wordpress/simplicity2-theme/ […]

  13. … [Trackback]

    […] Info on that Topic: blog.pippuriric.com/wordpress/simplicity2-theme/ […]

  14. Skrota bilen より:

    … [Trackback]

    […] Find More to that Topic: blog.pippuriric.com/wordpress/simplicity2-theme/ […]

  15. celeb nsfw より:

    … [Trackback]

    […] Read More Information here to that Topic: blog.pippuriric.com/wordpress/simplicity2-theme/ […]

  16. … [Trackback]

    […] Information on that Topic: blog.pippuriric.com/wordpress/simplicity2-theme/ […]

  17. drugsafetysite より:

    … [Trackback]

    […] Read More on to that Topic: blog.pippuriric.com/wordpress/simplicity2-theme/ […]

  18. … [Trackback]

    […] Read More here to that Topic: blog.pippuriric.com/wordpress/simplicity2-theme/ […]

  19. qiuqiu99 より:

    … [Trackback]

    […] Find More Information here on that Topic: blog.pippuriric.com/wordpress/simplicity2-theme/ […]

  20. mejaqq pkv より:

    … [Trackback]

    […] Find More Information here on that Topic: blog.pippuriric.com/wordpress/simplicity2-theme/ […]

  21. link nha cai より:

    … [Trackback]

    […] Here you can find 16441 additional Information on that Topic: blog.pippuriric.com/wordpress/simplicity2-theme/ […]

  22. … [Trackback]

    […] Find More on that Topic: blog.pippuriric.com/wordpress/simplicity2-theme/ […]

  23. dadu poker より:

    … [Trackback]

    […] Information to that Topic: blog.pippuriric.com/wordpress/simplicity2-theme/ […]

  24. duratrans nyc より:

    … [Trackback]

    […] Find More Info here on that Topic: blog.pippuriric.com/wordpress/simplicity2-theme/ […]

  25. … [Trackback]

    […] Read More Information here to that Topic: blog.pippuriric.com/wordpress/simplicity2-theme/ […]

  26. … [Trackback]

    […] Information to that Topic: blog.pippuriric.com/wordpress/simplicity2-theme/ […]

  27. Check This Out より:

    … [Trackback]

    […] Read More on that Topic: blog.pippuriric.com/wordpress/simplicity2-theme/ […]

  28. … [Trackback]

    […] Here you can find 37241 more Information on that Topic: blog.pippuriric.com/wordpress/simplicity2-theme/ […]

  29. … [Trackback]

    […] Find More on that Topic: blog.pippuriric.com/wordpress/simplicity2-theme/ […]

  30. Elise より:

    … [Trackback]

    […] Read More on that Topic: blog.pippuriric.com/wordpress/simplicity2-theme/ […]

  31. … [Trackback]

    […] Find More Info here on that Topic: blog.pippuriric.com/wordpress/simplicity2-theme/ […]

  32. Everleigh より:

    … [Trackback]

    […] Read More on that Topic: blog.pippuriric.com/wordpress/simplicity2-theme/ […]

  33. rajaqq より:

    … [Trackback]

    […] Find More here to that Topic: blog.pippuriric.com/wordpress/simplicity2-theme/ […]

  34. … [Trackback]

    […] Find More here on that Topic: blog.pippuriric.com/wordpress/simplicity2-theme/ […]

  35. rajapoker88 より:

    … [Trackback]

    […] Find More to that Topic: blog.pippuriric.com/wordpress/simplicity2-theme/ […]

  36. … [Trackback]

    […] There you can find 44954 more Information on that Topic: blog.pippuriric.com/wordpress/simplicity2-theme/ […]

  37. … [Trackback]

    […] Here you can find 60753 additional Information to that Topic: blog.pippuriric.com/wordpress/simplicity2-theme/ […]

  38. … [Trackback]

    […] Here you can find 9534 more Info to that Topic: blog.pippuriric.com/wordpress/simplicity2-theme/ […]

  39. … [Trackback]

    […] There you can find 28086 more Information on that Topic: blog.pippuriric.com/wordpress/simplicity2-theme/ […]

  40. boyaqq より:

    … [Trackback]

    […] There you can find 54237 more Information to that Topic: blog.pippuriric.com/wordpress/simplicity2-theme/ […]

  41. … [Trackback]

    […] Information on that Topic: blog.pippuriric.com/wordpress/simplicity2-theme/ […]

  42. … [Trackback]

    […] Read More here on that Topic: blog.pippuriric.com/wordpress/simplicity2-theme/ […]

  43. … [Trackback]

    […] Read More to that Topic: blog.pippuriric.com/wordpress/simplicity2-theme/ […]

  44. … [Trackback]

    […] Read More on to that Topic: blog.pippuriric.com/wordpress/simplicity2-theme/ […]

  45. … [Trackback]

    […] Find More on that Topic: blog.pippuriric.com/wordpress/simplicity2-theme/ […]