Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php get_header(); ?>
- <div class="primary-content">
- <div class="container extra-narrow paragraph">
- <div id="breadcrumbs">
- <a href="<?php echo home_url(); ?>">Home</a>
- <i class="fa fa-chevron-right" aria-hidden="true"></i>
- <a href="<?php echo $_SERVER['REQUEST_URI']; ?>">Search Results For: "<?php the_search_query(); ?>"</a>
- </div>
- <?php
- $args = array(
- 'post_type' => 'attachment',
- 's' => $_GET['s'],
- 'post_status' => 'any',
- 'posts_per_page' => -1,
- 'post__in' => get_category_resources(0)
- );
- $resources = new WP_Query($args);
- $args = array(
- 'posts_per_page' => -1,
- 'post_type' => 'page',
- 's' => $_GET['s']
- );
- $search_pages = new WP_Query($args);
- $total_found = $wp_query->found_posts + $resources->found_posts + $search_pages->found_posts;
- ?>
- <div class="grid spacer-bottom stack">
- <div class="tile onehalf paragraph short">
- <h3>Search Results</h3>
- <p><?php echo $total_found; ?> <?php echo $total_found != 1 ? 'Results' : 'Result' ?></p>
- </div>
- <div class="tile onehalf text-right mobile-text-left">
- <div id="search">
- <?php get_search_form(); ?>
- </div>
- </div>
- </div>
- <?php if ( have_posts() ) : ?>
- <h5><strong>Products</strong></h5>
- <?php while ( have_posts() ) : the_post(); ?>
- <?php get_template_part( 'includes/post-preview' ); ?>
- <?php endwhile; ?>
- <?php endif; ?>
- <?php if ( $resources->have_posts() ) : ?>
- <h5 class="spacer"><strong>Resources</strong></h5>
- <?php while ( $resources->have_posts() ) : $resources->the_post(); ?>
- <?php get_template_part( 'includes/post-preview' ); ?>
- <?php endwhile; wp_reset_postdata(); ?>
- <?php endif; ?>
- <?php if ( $search_pages->have_posts() ) : ?>
- <h5 class="spacer"><strong>Pages</strong></h5>
- <?php while ( $search_pages->have_posts() ) : $search_pages->the_post(); ?>
- <?php get_template_part( 'includes/post-preview' ); ?>
- <?php endwhile; wp_reset_postdata(); ?>
- <?php endif; ?>
- </div>
- </div>
- <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement