私はheader.phpでget_template_part( 'theme-templates/opt_header1')関数を使い、再びopt_header1.phpでget_template_part( 'carousal')関数を使っています。しかし、header.phpのget_template_part( 'theme-templates/opt_header1')関数は正常に動作していますが、opt_header1.phpの中の別のテンプレート部分を使用したいのですが、それは動作しません。get_template_part not working - WordPress
フォルダ構造は以下のようなものです...
[フォルダ]
[template-part]
... opt_header1.php
... carousal.php
[/template-part]
..header.php
[/フォルダ]
用い...
get_template_part('carousal');
ple ase help :)
お返事ありがとうございます。しかし、私に教えてください、私は** ** optuheader1.php ** **カロサル**を使用したいと思っています**両方のファイルはあなたのルートにあります。 まだ「theme-templates /」を追加する必要がありますか? –
はい: テーマのルートはテーマフォルダですのでご注意ください。 'theme-templates'はサブフォルダです。 get_template_part関数は、サブフォルダ内のどの程度深くても、テーマのルートパースペクティブから追加するファイルについて通知する必要があります。 –
ありがとう、それは働いた:) –