テーマ・親テーマおよび子テーマのディレクトリのURL、またはパスを取得する
テーマディレクトリの中の画像を読み込んだり、PHPでファイルを操作したりするには、そのファイルまでのURLやパスが必要になります。テーマのディレクトリのURLを取得するにはget_template_directory_uri()を、パスを取得するにはget_template_directory()を使用します。子テーマを使用する場合の注意についてもまとめます。
Copy and paste this URL into your WordPress site to embed
Copy and paste this code into your site to embed