Advertisement
Beee

search.php

Mar 14th, 2015
277
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.46 KB | None | 0 0
  1. <?php
  2.     if ( $wp_query->query_vars['post_type'] == 'event' ) {
  3.         $search_query = get_search_query();
  4.         query_posts( 's=' . $search_query . '&post_type=event&posts_per_page=' . get_option('posts_per_page') );       
  5.     }
  6. ?>
  7.  
  8. <?php while (have_posts()) : the_post(); ?>
  9.   <?php if ( $post->post_type == 'event' ) {
  10.         get_template_part('templates/content', 'sr-event' );
  11.     } else {
  12.         get_template_part('templates/content', 'list' );
  13.     }
  14.     ?>
  15. <?php endwhile; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement