I have this single.php...

  $post = $wp_query->post;
  if (in_category('portfolio')) {
  } elseif (in_category('video')) {

This all works, but there is a problem.

Example, I have Video as a parent category, and under category, or child category is Music, and if I tick that post only belongs to Music, than it will be single-text.php what will be used, how do I make it use single-video.php even if its not ticked in Video, but its child categories?

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.