Php 在发布searchform操作时检索参数

Php 在发布searchform操作时检索参数,php,wordpress,Php,Wordpress,我有一张搜索表 <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' ); ?

我有一张搜索表

       <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。但是,当我更改表单操作时,search.php不会重定向,而是重定向到index.php。我如何克服此问题。请帮助

我遵循默认的搜索方法,然后是主题“twentyeleven”

您想要更改方法属性,而不是操作


一个按钮和css可以解决这个问题

      .search_btn1{
         background:url(images/search_btn.jpg) no-repeat;
          width:20px;
         height:20px;
          border: 0;
         cursor:pointer;
       }

您好,很抱歉输入错误。我已经更新了。问题是当我更改方法时,重定向会发生在主页上,而不是默认的search.php。因此我需要知道在WordPress中编辑哪个文件以满足我的需要。或者确切地说,我需要隐藏URL上显示的图像按钮坐标。嗯,然后search.php似乎只接受GET参数。您还可以通过在表单中使用而不是来解决此问题。按钮上可以有图像或通过CSS的背景图像,并且不提交坐标。
      .search_btn1{
         background:url(images/search_btn.jpg) no-repeat;
          width:20px;
         height:20px;
          border: 0;
         cursor:pointer;
       }