Skip to content

Instantly share code, notes, and snippets.

@jchristopher
Last active January 1, 2016 20:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jchristopher/8200063 to your computer and use it in GitHub Desktop.
Save jchristopher/8200063 to your computer and use it in GitHub Desktop.
<?php if ( is_home() ) : ?>
<h2><?php echo the_title(); ?></h2>
<?php elseif ( is_search() ): ?>
<h1><?php
$search_count = 0;
$search = new WP_Query("s=$s&showposts=-1");
if($search->have_posts()) {
while($search->have_posts()) {
$search->the_post();
$search_count++;
}
}
echo $search_count;
?> <?php _e('Search results'); ?></h1>
<?php endif; ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment