Advertisement
Guest User

Untitled

a guest
Sep 23rd, 2014
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. function template_chooser($template)
  2. {
  3. global $wp_query;
  4. $post_type = get_query_var('post_type');
  5. if( $wp_query->is_search && $post_type == 'product' )
  6. {
  7. return locate_template('archive-products.php');
  8. } else {
  9. $args = array_merge( $wp_query->query, array( 'post_type' => 'post' ) );
  10. query_posts( $args );
  11. }
  12. return $template;
  13. }
  14. add_filter('template_include', 'template_chooser');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement