How to display multiple single page templates based on categories for WordPress?

Display multiple single page templates based on categories for WordPress.

Solution is like a below:


<?php

$post = $wp_query->post;

if ( in_category('20') )  //20 is define by category id{

include(TEMPLATEPATH . '/single1.php'); // single1.php is a one page.

} else {

include(TEMPLATEPATH . '/single2.php'); // single2.php is a one page.

}

?>

your problem has been solved.

About the Author

avatar