Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <div id="main">
- <section>
- <header>
- <hgroup>
- <h1 class="searchh1"><?php printf( __( 'Your search <span>"%s"</span> returned the following results', 'twentyeleven' ), '<span>' . get_search_query() . '</span>' ); ?></h1>
- </hgroup>
- </header>
- <?php
- $page_query = new WP_Query("s=$s&paged=$paged&showposts=5&post_type=page"); //$page_query->query_vars['post_type']='page';//query_posts("s=$s&paged=$paged&cat=-1,-11,-101");
- $post_query = new WP_Query("s=$s&paged=$paged&showposts=5&post_type=post"); //$post_query->query_vars['post_type']='post';//query_posts("s=$s&paged=$paged&cat=-1,-11,-101");
- ?>
- <?php if($post_query->have_posts()) :
- if(!$page_query->have_posts()) {$wp_query= null; $wp_query = clone $post_query;}
- ?>
- <h2 class="pagetitle">Post Search Results</h2>
- <table class="search">
- <tbody>
- <tr>
- <th>Book Name</th>
- <th>Author(s)</th>
- <th>Year Published</th>
- <th>Edition</th>
- <th>Publisher</th>
- <th></th>
- </tr>
- <?php while ($post_query->have_posts()) : $post_query->the_post(); ?>
- <?php
- get_template_part( 'content', 'searchbook' );
- ?>
- <?php endwhile; ?>
- </tbody>
- </table>
- <?php endif;?>
- <?php if ($page_query->have_posts()) :
- $wp_query= null; $wp_query = clone $page_query;
- ?>
- <h2 class="pagetitle">Page Search Results</h2>
- <table class="search">
- <tbody>
- <tr>
- <th>Module Name</th>
- <th>Module Code</th>
- <th>University</th>
- <th>Module Convenor</th>
- <th></th>
- </tr>
- <?php while ($page_query->have_posts()) : $page_query->the_post(); ?>
- <?php
- get_template_part( 'content', 'searchmodule' );
- ?>
- <?php endwhile; ?>
- </tbody>
- </table>
- <?endif; ?>
- <?php if (!$page_query->have_posts() && !$post_query->have_posts()) : ?>
- <h2 class="center">No results were found. Please try a different search?</h2>
- <?php include (TEMPLATEPATH . '/searchform.php'); ?>
- <?php endif; ?>
- </section><!-- #primary -->
- </div><!-- #content -->
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement