原因はカスタム投稿を導入していることだとは思うのですが、
いくら調べて試してみても反映されず困っています。。
まずカスタム投稿は、
php
1add_action('init', 'create_post_type'); 2function create_post_type(){ 3 register_post_type('ourstaff', [ 4 'labels' => [ 5 'name' => 'スタッフ', 6 'singular_name' => 'ourstaff', 7 ], 8 'public' => true, 9 'has_archive' => true, 10 'menu_position' => 5, 11 'supports' => array('title', 'editor', 'thumbnail', 'custom-fields'), 12 ]); 13}
このようにfunctions.phpに記載しています。
single.phpには、
php
1<?php 2if (in_category('ourstaff')) { 3 include(TEMPLATEPATH . '/single-ourstaff.php'); 4} else { 5 include(TEMPLATEPATH . '/single-news.php'); 6} 7?>
このように記載しています。
ourstaff(スタッフ)がカスタム投稿なのですが、
こちらは問題なくsingle-ourstaff.phpが出力されます。
しかし、newsの方がきちんとsingle-news.phpが反映されません。
もしどなたかお分かりになる方いらっしゃいましたらご回答いただけますと幸いです。。
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。