- 赤色のリンクは、まだ日本語Codexに存在しないページ・画像です。英語版と併せてご覧ください。(詳細)
「関数リファレンス/get home template」の版間の差分
提供: WordPress Codex 日本語版
< 関数リファレンス
(en:Function Reference/get_home_template 23:06, 13 December 2013 Mistercat 版を流し込み、Code Reference 最新版をマージ。) |
(和訳完了。) |
||
1行目: | 1行目: | ||
− | {{ | + | {{CheckTrans}} |
− | == Description == | + | == 説明<span id="Description"></span> == |
− | + | ||
− | + | 現在のテーマまたは親テーマの home テンプレートのパスを取得します。 | |
+ | |||
+ | まず <tt>'home.php'</tt> を探し、無ければ <tt>'index.php'</tt> へフォールバックします。 | ||
+ | |||
+ | == 使い方<span id="Usage"></span> == | ||
− | |||
<?php get_home_template() ?> | <?php get_home_template() ?> | ||
− | == Parameters == | + | == パラメータ<span id="Parameters"></span> == |
− | + | ||
− | + | なし。 | |
− | + | ||
− | == Examples == | + | == 戻り値<span id="Return_Values"></span> == |
+ | |||
+ | ; (文字列) : 現在のテーマまたは親テーマの home テンプレートのパス。 | ||
+ | |||
+ | == 用例<span id="Examples"></span> == | ||
<!-- Need creative examples. Feel free to link to external examples. --> | <!-- Need creative examples. Feel free to link to external examples. --> | ||
− | == Notes == | + | == 参考<span id="Notes"></span> == |
+ | |||
<!-- | <!-- | ||
− | * Uses: [[ | + | * Uses: [[Function Reference/apply_filters|<tt>apply_filters()</tt>]] Calls <tt>'home_template'</tt> on file path of home template. |
− | * Uses: [[ | + | * Uses: [[Function Reference/locate_template|<tt>locate_template()</tt>]] on <tt>'home.php'</tt> and <tt>'index.php'</tt>. |
--> | --> | ||
− | * | + | * 内部で [[関数リファレンス/get_query_template|<tt>get_query_template()</tt>]] を使います。 |
+ | |||
+ | * テンプレート階層とテンプレートのパスをフィルターで変えられます。動的なフィルター <tt>'$type_template_hierarchy'</tt> と <tt>'$type_template'</tt> で、<tt>$type</tt> は 'home' です。 | ||
− | + | == 変更履歴<span id="Change_Log"></span> == | |
− | + | 新規導入: 1.5.0 | |
− | + | ||
− | == | + | == ソースファイル<span id="Source_File"></span> == |
− | <tt>get_home_template()</tt> | + | <tt>get_home_template()</tt> は {{Trac|wp-includes/template.php}} にあります。 |
− | == Related == | + | == 関連項目<span id="Related"></span> == |
{{Tag Footer}} | {{Tag Footer}} |
2018年6月2日 (土) 11:59時点における最新版
この項目「関数リファレンス/get home template」は、翻訳チェック待ちの項目です。加筆、訂正などを通して、Codex ドキュメンテーションにご協力下さい。
説明
現在のテーマまたは親テーマの home テンプレートのパスを取得します。
まず 'home.php' を探し、無ければ 'index.php' へフォールバックします。
使い方
<?php get_home_template() ?>
パラメータ
なし。
戻り値
- (文字列)
- 現在のテーマまたは親テーマの home テンプレートのパス。
用例
参考
- 内部で get_query_template() を使います。
- テンプレート階層とテンプレートのパスをフィルターで変えられます。動的なフィルター '$type_template_hierarchy' と '$type_template' で、$type は 'home' です。
変更履歴
新規導入: 1.5.0
ソースファイル
get_home_template() は wp-includes/template.php
にあります。
関連項目
関数リファレンス、テンプレートタグ目次もご覧ください。