Answer the question
In order to leave comments, you need to log in
How to make wordpress run default post template after if?
Good!
For some posts I use a different template, here is the code:
function single_partner() {
if (is_single(array(891,215,3644,1055,2122,2104,1962,3702,6281,1442))) {
return TEMPLATEPATH . '/single-partner.php';
}
else {
return TEMPLATEPATH . '/single.php';
;}
}
add_filter('single_template', 'single_partner');
Answer the question
In order to leave comments, you need to log in
function single_partner_template( $single_template ) {
if ( is_single( array( 891, 215, 3644, 1055, 2122, 2104, 1962, 3702, 6281, 1442 ) ) ) {
$single_template = dirname( __FILE__ ) . '/single-partner.php';
}
return $single_template;
}
add_filter( 'single_template', 'single_partner_template' );
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question