我有搜索表单。
<form method="get" id="searchform" action="<?php bloginfo('siteurl');?>">
<div class="search_bx1"><input type="text" class="field" name="s" id="s" placeholder="<?php esc_attr_e( 'Search', 'mclaren' ); ?>" /></div>
<div class="search_btn1">
<input type="image" class="submit" name="submit" id="searchsubmit" src="<?php bloginfo('template_directory'); ?>/images/search_btn.jpg" width="22" height="20" value="<?php esc_attr_e( 'Search', 'twentyeleven' ); ?>" />
</div>
</form>
我需要隐藏来自url的图像坐标。所以我认为我需要将表单方法更改为post.But当我更改表单操作时,search.php不会发生重定向而是转到index.php。我怎么能克服这个。请帮忙吗?
我遵循默认搜索方法,然后是主题'twentyeleven'
答案 0 :(得分:0)
您想要更改 method
属性,而不是action
;
<form method="POST" id="searchform" action="<?php bloginfo('siteurl');?>">
答案 1 :(得分:0)
按钮和CSS可以解决问题..
.search_btn1{
background:url(images/search_btn.jpg) no-repeat;
width:20px;
height:20px;
border: 0;
cursor:pointer;
}