functions.php
1 2 3 4 5 6 7 8 9 10 11 12 13 |
function enable_post_type_search_template($template){ if ( is_search() ) { $post_types = get_query_var('post_type'); foreach ( (array) $post_types as $post_type ) $templates[] = "search-{$post_type}.php"; $templates[] = 'search.php'; $template = get_query_template('search',$templates); } return $template; } add_filter('template_include','enable_post_type_search_template'); |
コメント