get_stylesheet

Sponsored Link

現在のスタイルシートの名前を取得します。

管理者が現在のフロントエンドテーマとして設定したテーマ名です。

全ての大規模な目的のために、テンプレート名とスタイルシート名は殆どの場合に同じになるだろう。子テーマを使用した場合、親よりも返される名前です。

Sponsored Link

Retrieve name of the current stylesheet.

The theme name that the administrator has currently set the front end theme as.

For all extensive purposes, the template name and the stylesheet name are going to be the same for most cases. In the event that you use a child theme, that is the name that will be returned, rather than the parent.

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

<?php get_stylesheet(); ?>

get_stylesheetのパラメーター

None.

戻り値

uri (string)
スタイルシート名です。

(string)
Stylesheet name.

注釈

  • 用途: apply_filters()は、スタイルシート上の’stylesheet’を呼び出します。
  • 用途: ‘stylesheet’オプションを取得するためにget_option() です。
  • 子テーマが使用されている場合、返す名前であり、親テーマ名ではありません(親テーマディレクトリーにしたい場合は、その代わりにget_template_directory()を使用します)。
  • Uses: apply_filters() Calls ‘stylesheet’ filter on stylesheet name.
  • Uses: get_option() to retrieve the ‘stylesheet’ option.
  • In the event a child theme is being used, that is the name that will be returned, not the parent theme name (use get_template_directory() instead if you want the parent directory)

変更ログ

Since: 1.5.0

ソースファイル

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

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

Sponsored Link