Include More than 2 Singles.php


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. <?php
  2. $post = $wp_query->post;
  3. if ( in_category('3') ) {
  4. include(TEMPLATEPATH . '/single-blog.php'); }
  5. elseif ( in_category('15') ) {
  6. include(TEMPLATEPATH . '/single-foto.php'); }
  7. elseif ( in_category('18') ) {
  8. include(TEMPLATEPATH . '/single-video.php'); }
  9. else { include(TEMPLATEPATH . '/single-default.php');
  10. }
  11. ?>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.