Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function template_chooser($template)
- {
- global $wp_query;
- $post_type = get_query_var('post_type');
- if( $wp_query->is_search && $post_type == 'product' )
- {
- return locate_template('archive-products.php');
- } else {
- $args = array_merge( $wp_query->query, array( 'post_type' => 'post' ) );
- query_posts( $args );
- }
- return $template;
- }
- add_filter('template_include', 'template_chooser');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement