This is really bizarre - this has never happened before :/
I have a search.php template which consists of this...
<?php
/**
* @package WordPress
* @subpackage Example 2012
* @since Example 1.0
*/
get_header(); ?>
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<?php the_title(); ?>
<?php endwhile; ?>
<?php endif; wp_reset_query(); ?>
<?php get_footer(); ?>
this is what is in my functions.php
// SEARCH FORM HEADER
function search_form_header( $form ) {
$form = '<form method="get" id="header-searchform" action="' . home_url( '/' ) . '" >
<div>
<div class="searchform-left"></div>
<input class="searchform-mid clearit" type="text" name="search" id="search-header" value="Search" />
<div class="searchform-right"></div>
</div>
</form>';
return $form;
}
add_filter( 'get_search_form', 'search_form_header' );
and this is how I'm calling my form...
<?php get_search_form('search_form_header'); ?>
And this is what my URL looks like when a search is performed (search query hello)...
/?search=hello
And all I get is the index.php?
And ideas would be truly amazing thanks. If you need more info please let me know thanks.
This is really bizarre - this has never happened before :/
I have a search.php template which consists of this...
<?php
/**
* @package WordPress
* @subpackage Example 2012
* @since Example 1.0
*/
get_header(); ?>
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<?php the_title(); ?>
<?php endwhile; ?>
<?php endif; wp_reset_query(); ?>
<?php get_footer(); ?>
this is what is in my functions.php
// SEARCH FORM HEADER
function search_form_header( $form ) {
$form = '<form method="get" id="header-searchform" action="' . home_url( '/' ) . '" >
<div>
<div class="searchform-left"></div>
<input class="searchform-mid clearit" type="text" name="search" id="search-header" value="Search" />
<div class="searchform-right"></div>
</div>
</form>';
return $form;
}
add_filter( 'get_search_form', 'search_form_header' );
and this is how I'm calling my form...
<?php get_search_form('search_form_header'); ?>
And this is what my URL looks like when a search is performed (search query hello)...
http://www.example.co.uk/?search=hello
And all I get is the index.php?
And ideas would be truly amazing thanks. If you need more info please let me know thanks.
Change the form to:
<input class="searchform-mid clearit" type="text" name="s" id="search-header" value="Search" />
Check that name should be "s" as that the get attribute wordpress use for search keyword