AMP 条件に応じて、テンプレートを変える

functions.php

--------------

// 条件に応じて使用するテンプレートを変更する
function my_temp($file, $type, $post) {
if($type =='single.php' && in_category('カテゴリー名',$pos)) {
$file = dirname(__FILE__) . 'amp/single-arrange.php';
}
return $file;
}
add_filter('amp_post_template_file', 'my_temp', 10,3);