Posts: 876
Name: Matt Pealing
Location: England, north west
|
I have my homepage set to a static page, and it's confused me about how to set up a search results page!
I have search.php like so:
PHP Code:
<?php get_header(); ?> <div id="span-sub"> <span class="title">THE WORLD'S ONLY PAINLESS LASER HAIR REMOVAL</span> <p>Right for you... Painless, faster, safer, more cost effective, often outperforming other lasers. For every part of your face and body.</p> </div><!--end span-sub--> <?php include(TEMPLATEPATH . '/include/cta-btn.php'); ?> <div id="page"> <div id="content"> <?php if(have_posts()) : ?> <?php while(have_posts()) : the_post(); ?> <h1>Results for '<?php the_search_query(); ?>'</h1> <?php the_content(); ?> <?php endwhile; ?> <?php endif; ?> </div><!--end content--> <?php get_sidebar(); ?> <?php get_footer(); ?>
And here's what searchform.php looks like:
Code:
<form method="post" action="<?php bloginfo('url'); ?>" id="searchform">
<div>
<input type="text" name="s" value="Search The Site" />
<input class="frm-btn" type="submit" name="frm-search-submit" value="" />
</div>
</form>
But whenever I perform a search, I am just taken to a blank page. I am not even shown the h1 tag; " <h1>Results for '<?php the_search_query(); ?>'</h1>"
I think the page is sending me to the homepage, but that can't display the results because it's just a static page!
Do I just need to update the 'action' attribute of the form?
Thanks.
Last edited by pealo86; 07-19-2010 at 04:40 PM..
|