Skip to content

Instantly share code, notes, and snippets.

@davechu
Last active August 29, 2015 13:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davechu/9974887 to your computer and use it in GitHub Desktop.
Save davechu/9974887 to your computer and use it in GitHub Desktop.
This reduces search output so all you get is the phrase you searched on, followed by just links, no excerpt, meta, and so on.
<?php
/**
* Search Results Template File
*/
get_header(); ?>
<header>
<h1>Search Results: &quot;<?php echo get_search_query(); ?>&quot;</h1>
<br>
</header>
<?php if ( have_posts() ) : // results found?>
<?php while ( have_posts() ) : the_post(); ?>
<article>
<p> <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a> </p>
</article>
<?php endwhile; ?>
<?php else : // no results?>
<article>
<h1>No Results Found.</h1>
</article>
<?php endif; ?>
<?php get_footer(); ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment