Kristen
Member
Posted 8 months ago #
Hello,
I am using this solution: http://wordpress.org/support/topic/have-a-second-singlephp-file-for-different-single-post-look?replies=29
Like this:
<?php
$post = $wp_query->post;
if ( in_category('5') ) {
include("single2.php");
} else {
include("single1.php");
}
?>
to give a different look to posts of a certain category. I need to do this for 2 categories, not just 1. How would I add another category to this?
Any help is appreciated! Thanks!
If you want different theme for both of them then use this
<?php
$post = $wp_query->post;
if ( in_category('5') ) {
include("single2.php");
}elseif(in_category('7')) {
include("single3.php");
} else {
include("single1.php");
}
?>
You would add an elseif statement, something like this:
<?php
$post = $wp_query->post;
if ( in_category( '5' ) ) {
include( "single2.php" );
} elseif( in_category( '6' ) ) {
include( "single3.php" );
} else {
include( "single1.php" );
}
?>
Kristen
Member
Posted 8 months ago #
Thank you both so much for your help!