get_stylesheet_directory_uri

Sponsored Link

スタイルシートディレクトリのURIを取得します。SSLの有無をチェックします。

これが適切にフォーマットされたURIを返すことに注意してください;言い換えると、Webアドレスになります(http:// 或いは https:// などを完備 )。このように、追加のスタイルシート、或いはおそらく元も一般的な画像を参照している、最も適切なリンクに使用されています(この例では、template .phpファイル内の

.wp-menu-image { background: url(<?php echo get_stylesheet_directory_uri() ?>/images/gavel.png) }

If you want to link to a local file, use get_stylesheet_directory() instead.

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

<?php get_stylesheet_directory_uri() ?>

get_stylesheet_directory_uriのパラメーター

None.

戻り値

uri (string)
スタイルシートディレクトリURIを返します。

uri (string)
Returns stylesheet directory URI.

画像 (HTML)

<img src="<?php echo get_stylesheet_directory_uri() ?>/images/aternus.png" alt="" title="" width="" height="" />

注釈

  • Uses: apply_filters()はスタイルシートパスと名前で'stylesheet_directory_uri'を呼び出します。
  • Uses: get_stylesheet()
  • Uses: get_theme_root()
  • 子テーマが使用されている場合、返されるディレクトリURIで、親テーマディレクトリーURI(親ディレクトリーが必要な場合、代わりにget_template_directory_uri()を使用)ではありません。
  • Uses: apply_filters() Calls 'stylesheet_directory_uri' filter on stylesheet path and name.
  • Uses: get_stylesheet()
  • Uses: get_theme_root()
  • In the event a child theme is being used, that is the directory URI that will be returned, not the parent theme directory URI (use get_template_directory_uri() instead if you want the parent directory)

変更ログ

Since: 1.5.0

ソースファイル

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

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

関連ファンクションタグ

  • get_stylesheet_uri();
  • get_bloginfo( 'stylesheet_directory' );
Sponsored Link