Still having trouble. Are you saying I should copy and paste the code from search.php into the searchform.php code in my theme? Either way, search.php in the default theme doesn’t seem to contain that piece of code either. It looks like this:
<?php get_header(); ?>
<div id="content" class="narrowcolumn">
<?php if (have_posts()) : ?>
<h2 class="pagetitle">Search Results</h2>
<div class="navigation">
<div class="alignleft"><?php next_posts_link('« Older Entries') ?></div>
<div class="alignright"><?php previous_posts_link('Newer Entries »') ?></div>
</div>
<?php while (have_posts()) : the_post(); ?>
<div class="post">
<h3 id="post-<?php the_ID(); ?>"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h3>
<small><?php the_time('l, F jS, Y') ?></small>
<p class="postmetadata"><?php the_tags('Tags: ', ', ', '<br />'); ?> Posted in <?php the_category(', ') ?> | <?php edit_post_link('Edit', '', ' | '); ?> <?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?></p>
</div>
<?php endwhile; ?>
<div class="navigation">
<div class="alignleft"><?php next_posts_link('« Older Entries') ?></div>
<div class="alignright"><?php previous_posts_link('Newer Entries »') ?></div>
</div>
<?php else : ?>
<h2 class="center">No posts found. Try a different search?</h2>
<?php include (TEMPLATEPATH . '/searchform.php'); ?>
<?php endif; ?>
</div>
<?php get_sidebar(); ?>
<?php get_footer(); ?>
My searchform.php looks like this:
<form method="get" id="searchform" action="<?php bloginfo('home'); ?>/">
<?php if (strlen(get_search_query()) > 0) { ?>
<input type="text" onfocus="if (this.value == '<?php the_search_query(); ?>') {this.value = '';}" onblur="if (this.value == '') {this.value = '<?php the_search_query(); ?>';}" value="<?php the_search_query(); ?>" name="s" id="s" />
<?php } else { ?>
<input type="text" onfocus="if (this.value == 'Search') {this.value = '';}" onblur="if (this.value == '') {this.value = 'Search';}" value="Search" name="s" id="s" />
<?php } ?>
</form>
The code i’ve copied and pasted into a text widget (since I like the disappearing text in the text box) is this:
<form name=form1 method="get" action="https://timeforjazz.com/">
<input type="text" name="s" id="s" size="32" class="searchform-textbox" value="Type & Hit Enter to Search" onclick="document.form1.s.value ='';">
</form>
What I want is for the search results to come back with excerpts (like I was using a search engine) and not just the whole pages/posts stacked on top of one another.