search templates based on post type
-
Is it possible have multiple search templates based on post type?
I places this code in search.php
<?php if( get_post_type() == 'dog' ) { include( TEMPLATEPATH.'/search2.php' ); }else if ( get_post_type() == 'cat' ) { include( TEMPLATEPATH.'/search2.php' ); }else if ( get_post_type() == 'wolf' ) { include( TEMPLATEPATH.'/search2.php' ); }else if ( get_post_type() == 'leon' ) { include( TEMPLATEPATH.'/search2.php' ); }else if ( get_post_type() == 'tiger' ) { include( TEMPLATEPATH.'/search2.php' ); }else if ( get_post_type() == 'panther' ) { include( TEMPLATEPATH.'/search2.php' ); }else if ( get_post_type() == 'mouse' ) { include( TEMPLATEPATH.'/search3.php' ); } ?>Seems that works but when I do a research without results I get blank page. I dont know why! Can you help me please?
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
The topic ‘search templates based on post type’ is closed to new replies.