LoginSignup
4
4

More than 5 years have passed since last update.

WordPressのテンプレート階層にレイアウトを組み込む wordpress-layout-style-theme

Last updated at Posted at 2014-03-03

WordPressの、 コンテンツを出力するテンプレート(single.phpとかindex.phpとか)で、get_header関数でhtml開き、head、body開き〜header、コンテンツ出力して、get_footer関数でfooter〜body、html閉じる というテンプレートの展開のしかたが気持ち悪かったので、get_headerとかをレイアウトテンプレートにまとめられるものを作ってみました。

wordpress-layout-style-theme

これを使用した際のデフォルトのレイアウトでは、header.phpにheaderタグの中身、footer.phpにfooterタグの中身を書く形になります。

「カスタムヘッダーを使うときに、get_header関数呼ぶだけでいい形になるので便利」(同僚談)

利用の際はComposerを使うと便利ですが、使わない場合は、LayoutStyleThemeFacadeクラスを使わないか、atomita/php-facade を合わせて利用してください。

4
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
4