WordPressで現在有効化しているテーマのディレクトリを取得するテンプレートタグです。
get_template_directory_uri();
使用例
※テンプレート以降のパスは適宜変更してください。
テーマディレクトリにアップしている画像を表示
1 2 3 4 5 | <imgsrc="<?phpechoget_template_directory_uri();?>/images/top/gazou1.jpg"alt=""> |
テーマディレクトリのスタイルシートを表示
1 2 3 4 5 | <imgsrc="<?phpechoget_template_directory_uri();?>/style.css"> |
コメント