我现在正在做这个website 测试表明搜索页面工作不正常。每次有人搜索某个东西,结果都是空白的。搜索页面的代码如下所示。
Search Form:
<form role="search" method="get" id="searchform" action="/search/" >
<div><label class="screen-reader-text" for="s">Search for:</label>
<input type="text" value="" name="s" id="s" />
<input type="image" src="<?php bloginfo(\'stylesheet_directory\'); ?>/images/searcher1.png"id="searchsubmit" value="Search" />
</div>
</form>
Search Page:
<?php
if ( isset( $_REQUEST[ \'search\' ] ) ) {
// run search query
query_posts( array(
\'s\' => $_REQUEST[ \'search\' ],
\'post_type\' => $_REQUEST[ \'post_type\' ],
) );
// loop
if ( have_posts() ) : while ( have_posts() ) :
// loop through results here
endwhile; endif;
// return to original query
wp_reset_query();
}