Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php include(TEMPLATEPATH."/rich.inc.php"); get_header(); ?>
- <?php include(TEMPLATEPATH."/header_includes.php");?>
- <!-- Begin search.php -->
- <div id="wrapper">
- <div id="page-title-container" class="container_12 containermargin">
- <div class="grid_12">
- <h1 class="entry-title"><?php printf( __( 'Search Results for: %s', 'richwp' ), '<span>' . get_search_query() . '</span>' ); ?></h1>
- </div>
- </div>
- <div class="container_12 containermargin">
- <div id="content" class="grid_8">
- <hr />
- <?php
- global $query_string;
- $query_args = explode("&", $query_string);
- $search_query = array();
- foreach($query_args as $key => $string) {
- $query_split = explode("=", $string);
- $search_query[$query_split[0]] = $query_split[1];
- } // foreach
- $search_wp_query = new WP_Query($search_query);
- ?>
- <?php if (have_posts()) : ?>
- <?php
- //$search_query = new WP_Query('orderby=date&order=DESC&paged=' . $paged);
- while ($search_wp_query->have_posts()) : $search_wp_query->the_post();
- ?>
- <div class="post_content" id="post-<?php the_ID(); ?>">
- <?php // Hack to highlight search results - see http://www.problogdesign.com/wordpress/3-codes-for-a-far-better-wordpress-search-page/ ?>
- <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Link to <?php the_title_attribute(); ?>" alt="Link to <?php the_title_attribute(); ?>"><?php $title = get_the_title(); $keys= explode(" ",$s); $title = preg_replace('/('.implode('|', $keys) .')/iu', '<span class="search_highlight">\0</span>', $title); ?>
- <?php echo $title; ?></a></h2>
- <?php
- /*
- $excerpt = get_the_excerpt(); $excerpt = preg_replace('/('.implode('|', $keys) .')/iu', '<span class="search_highlight">\0</span>', $excerpt);
- */
- ?>
- <?php //echo $excerpt;
- ?>
- <?php the_excerpt();?>
- </div>
- <?php endwhile;?>
- <?php /* Display navigation to next/previous pages when applicable */ ?>
- <div id="nav-below" class="meta-nav navigation navigationboxes">
- <?php
- if(function_exists('wp_pagenavi')) {
- wp_pagenavi( array(
- 'query' =>$search_wp_query
- ));
- }
- ?>
- </div><!-- #nav-below -->
- <?php else: ?>
- Sorry, no results found. Try broadening your search.
- <!-- begin search box -->
- <form method="get" id="searchform-header" action="<?php echo home_url(); ?>" >
- <ins>
- <input type="text" class="searchbox" name="s" id="search-body" value="Search" onfocus="this.value=(this.value=='Search') ? '' : this.value;" onblur="this.value=(this.value=='') ? 'Search' : this.value;"/>
- </ins>
- </form>
- <!-- end search box -->
- <?php endif; ?>
- </div>
- <div class="grid_4">
- <?php get_sidebar();?>
- </div>
- </div>
- </div><!-- #wrapper -->
- <!-- End search.php -->
- <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement