Title: get_stylesheet_directory_uri()　と　get_stylesheet_uri()　の違いについて
Last modified: 2017年1月29日

---

# get_stylesheet_directory_uri()　と　get_stylesheet_uri()　の違いについて

 *  [Hiroyuki.I](https://ja.wordpress.org/support/users/hiroyukii/)
 * (@hiroyukii)
 * [10年、 3ヶ月前](https://ja.wordpress.org/support/topic/get_stylesheet_directory_uri%e3%80%80%e3%81%a8%e3%80%80get_stylesheet_uri%e3%80%80%e3%81%ae%e9%81%95%e3%81%84%e3%81%ab%e3%81%a4%e3%81%84%e3%81%a6/)
 * スタイルシート（style.css）までのパスの取得に get_stylesheet_uri() を使ってい
   ますが、
    似た関数である get_stylesheet_directory_uri() との違いがよくわかりま
   せん。
 * 実際、<link rel=”stylesheet” href=”<?php echo get_stylesheet_uri(); ?>”> では
   うまくstyle.cssへのリンクが貼れましたが、
    <link rel=”stylesheet” href=”<?php
   echo get_stylesheet_directory_uri(); ?>”>では、テーマのディレクトリまでしか取得
   できていない状態です。
 * Codexを見てみても、違いや、なぜ後者がうまくstyle.cssにまで届かないのかがかわり
   ません。
    ちなみにローカル環境ですが、これが問題なのでしょうか。

4件の返信を表示中 - 1 - 4件目 (全4件中)

 *  [Daisuke Takahashi](https://ja.wordpress.org/support/users/extendwings/)
 * (@extendwings)
 * [10年、 3ヶ月前](https://ja.wordpress.org/support/topic/get_stylesheet_directory_uri%e3%80%80%e3%81%a8%e3%80%80get_stylesheet_uri%e3%80%80%e3%81%ae%e9%81%95%e3%81%84%e3%81%ab%e3%81%a4%e3%81%84%e3%81%a6/#post-178099)
 * get_stylesheet_directory_uri()はスタイルシートのあるディレクトリのURIが取得でき
   ていれば正常です。
    詳しくはリファレンスからソースコードレベルで見た方が早いです。
    - [https://developer.wordpress.org/reference/functions/get_stylesheet_directory_uri/](https://developer.wordpress.org/reference/functions/get_stylesheet_directory_uri/)
    - [https://developer.wordpress.org/reference/functions/get_stylesheet_uri/](https://developer.wordpress.org/reference/functions/get_stylesheet_uri/)
 *  トピック投稿者 [Hiroyuki.I](https://ja.wordpress.org/support/users/hiroyukii/)
 * (@hiroyukii)
 * [10年、 3ヶ月前](https://ja.wordpress.org/support/topic/get_stylesheet_directory_uri%e3%80%80%e3%81%a8%e3%80%80get_stylesheet_uri%e3%80%80%e3%81%ae%e9%81%95%e3%81%84%e3%81%ab%e3%81%a4%e3%81%84%e3%81%a6/#post-178100)
 * Daisuke Takahashi 様
 * ありがとうございます。
 * 「get_stylesheet_directory_uri()はスタイルシートのあるディレクトリのURI」の取得
   ということは、通常はstyle.cssはテーマフォルダ直下にあるので、テーマフォルダの
   ディレクトリを取得している、ということで良いのですね。
 * 実は、あるWordPressの参考書を読んでいたところ、
    <link rel=”stylesheet” href=”
   <?php echo get_stylesheet_directory_uri(); ?>”> で、style.cssへのリンクが貼れる
   ということが書かれていたので、疑問に思っていました。
 *  [Daisuke Takahashi](https://ja.wordpress.org/support/users/extendwings/)
 * (@extendwings)
 * [10年、 3ヶ月前](https://ja.wordpress.org/support/topic/get_stylesheet_directory_uri%e3%80%80%e3%81%a8%e3%80%80get_stylesheet_uri%e3%80%80%e3%81%ae%e9%81%95%e3%81%84%e3%81%ab%e3%81%a4%e3%81%84%e3%81%a6/#post-178102)
 * その方法でスタイルシートを参照するには、どう頑張っても”style.css”と後ろにつけ
   てあげるしかないです。
    ミスとして、出版社とかに連絡しておくと喜ばれるかもしれ
   ませんね。
 *  トピック投稿者 [Hiroyuki.I](https://ja.wordpress.org/support/users/hiroyukii/)
 * (@hiroyukii)
 * [10年、 3ヶ月前](https://ja.wordpress.org/support/topic/get_stylesheet_directory_uri%e3%80%80%e3%81%a8%e3%80%80get_stylesheet_uri%e3%80%80%e3%81%ae%e9%81%95%e3%81%84%e3%81%ab%e3%81%a4%e3%81%84%e3%81%a6/#post-178105)
 * Daisuke Takahashi 様
 * ありがとうございます。
 * 出版社のサイトの正誤表にもまだ掲載されていなかったので、お問い合わせから知らせ
   ておきました。
 * 返事が来たら、またこちらでお知らせします。

4件の返信を表示中 - 1 - 4件目 (全4件中)

 トピック「get_stylesheet_directory_uri()　と　get_stylesheet_uri()　の違いについて」
には新たに返信することはできません。

## タグ

 * [スタイルシート](https://ja.wordpress.org/support/topic-tag/%e3%82%b9%e3%82%bf%e3%82%a4%e3%83%ab%e3%82%b7%e3%83%bc%e3%83%88/)
 * [style.css](https://ja.wordpress.org/support/topic-tag/style-css/)

 * フォーラム: [使い方全般](https://ja.wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 4件の返信
 * 2人の参加者
 * 最後の返信者: [Hiroyuki.I](https://ja.wordpress.org/support/users/hiroyukii/)
 * 最後の活動: [10年、 3ヶ月前](https://ja.wordpress.org/support/topic/get_stylesheet_directory_uri%e3%80%80%e3%81%a8%e3%80%80get_stylesheet_uri%e3%80%80%e3%81%ae%e9%81%95%e3%81%84%e3%81%ab%e3%81%a4%e3%81%84%e3%81%a6/#post-178105)
 * 状態: 未解決

## トピック

### 人気のトピック

### 返信がないトピック

### サポート関連ではないトピック

### 解決済みのトピック

### 未解決のトピック

### すべてのトピック
