get_category_template

Sponsored Link

現在または親テンプレート内にカテゴリテンプレートのパスを取得します。

現在のカテゴリIDを取得することにより動作します。例えば’category-1.php’やカテゴリーIDファイルが存在しない場合のcategory.phpテンプレートにフォールバックします。

Sponsored Link

Retrieve path of category template in current or parent template.

Works by retrieving the current category ID, for example ‘category-1.php’ and will fallback to category.php template, if the category ID file doesn’t exist.

get_category_templateのファンクションタグ使用方法

<?php get_category_template() ?>

get_category_templateのパラメーター

なし

None.

返り値

(string)現在または親テンプレート内にカテゴリテンプレートのパスを返します。

(string)
Returns path of category template in current or parent template.

注釈

  • 使用方法: apply_filters()は、カテゴリーテンプレートのファイルパス上に’category_template’を呼び出します。
  • 使用方法: locate_template()
  • 使用方法: get_query_var() on ‘cat’.
  • Uses: apply_filters() Calls ‘category_template’ on file path of category template.
  • Uses: locate_template()
  • Uses: get_query_var() on ‘cat’.

変更ログ

Since: 1.5.0

ソースファイル

get_category_template()は、wp-includes/theme.php内に位置しています。

get_category_template() is located in wp-includes/theme.php.

Sponsored Link