Last active
January 1, 2016 20:58
-
-
Save jchristopher/8200063 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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