Help us understand the problem. What is going on with this article?

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

More than 5 years have passed since last update.

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 を合わせて利用してください。

atomita
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした