[wordpress/php] テンプレートphpファイルに値を渡す方法
テンプレートphpファイルを参照するには以下のコードを実装するが値が渡せない
// テーマフォルダ内の「content-product.php」をロードする <?php get_template_part( 'content', 'product' ); ?>
テンプレートphpファイルに値を渡す方法はlocate_templateを使用してテンプレートphpをincludeする
$hogehoge = "hogehoge"; include locate_template( 'content-product.php' );