例えば上記のように、特定の親カテゴリと、その子カテゴリ以下に「xxx.php」を表示したい場合は下記の通り。 (仮に、親カテゴリーが「news」でIDが「1」だった場合の記述です。) <?php //現在のカテゴリを取得 $cat_now = get_the_category(); $cat_now = $cat_now[0]; //親カテゴリを取得 $parent_id = $cat_now->category_parent; //親カテゴリーが「news(IDは「1」)」だった場合、「xxx.php」を出力 if ( is_category(‘news’)||$parent_id == ‘1’ ) { require(‘xxx.php’); echo ‘このページの親カテゴリはNewsです。’; } else { } ?> ※指定したphpのファイルの中身を呼び出す際は「require