mutiple layout for single post - wordpress


/ 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('1') ) {
  4. include('single-foo1.php');
  5. } elseif ( in_category('2') ) {
  6. include('single-foo2.php');
  7. }
  8. else {
  9. include('single-normal.php');
  10. }
  11. ?>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.