<?php $post = $wp_query->post; if(in_category('information')){ include(TEMPLATEPATH . '/single-information.php'); } elseif(in_category('event')){ include(TEMPLATEPATH . '/single-event.php'); } elseif(in_category('blog')){ include(TEMPLATEPATH . '/single-blog.php'); } else{ include(TEMPLATEPATH . '/single-defalut.php'); } ?>
やってみたら、できた。
![](https://i0.wp.com/www.narugaro.com/cms/wp-content/uploads/2018/12/cropped-icon-1-1.png?fit=512%2C512&ssl=1)
![](https://i0.wp.com/www.narugaro.com/cms/wp-content/uploads/2018/12/cropped-icon-1-1.png?fit=512%2C512&ssl=1)
single.phpをカテゴリ毎に分岐したかったけど、できなくて…
WordPressの個別記事ページをカテゴリ毎に違うものにしたかったので、分岐を書きました!! 全部、sing…
コメント