将搜索测试替换为图标搜索

时间:2018-02-04 09:28:57

标签: php html debugging

我可以通过替换

在chrome developer tool元素中用搜索图标替换搜索文本



<input type="submit" value="search">
&#13;
&#13;
&#13; 有了这个:
&#13;
&#13;
<button type="submit" id="searchsubmit" />
<span class="icon"><i class="fa fa-search"></i></> 
</button>
&#13;
&#13;
&#13;

这是主题searchform.php

&#13;
&#13;
<?php
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly

?><form role="search" method="get" class="pojo-form form-search" action="<?php echo home_url( '/' ); ?>">
	<label for="s">
		<span class="sr-only"><?php _e( 'Search for:', 'pojo' ); ?></span>
	</label>
	<input type="search" title="<?php _e( 'Search', 'pojo' ); ?>" name="s" value="<?php echo ( isset( $_GET['s'] ) ) ? $_GET['s'] : ''; ?>" placeholder="<?php _e( 'Search...', 'pojo' ); ?>" class="field search-field">
	<button value="<?php _e( 'Search', 'pojo' ); ?>" class="search-submit button" type="submit"><?php _e( 'Search', 'pojo' ); ?></button>
</form>
&#13;
&#13;
&#13;

我的问题是 如何修改searchform.php以获取搜索图标 https://krush.co.il/

1 个答案:

答案 0 :(得分:0)

<button class="search-submit button" type="submit"><span class="icon"><i class="fa fa-search"></i></span></button>

您不需要同时拥有按钮的值和按钮标记的内部html。您只想用图标html更改搜索文本。