Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?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