添加search.php
导航标题:
<?php wp_title(”);?><?php /* Search Count */ $allsearch = &new WP_Query(“s=$s&showposts=-1″); $key = wp_specialchars($s, 1); $count = $allsearch->post_count; _e(”); _e(‘<span class=”search-terms”>’); _e(‘</span>’); _e(‘ — ‘); echo $count . ‘ ‘; _e(‘条相关结果’); wp_reset_query(); ?>
在header.php中添加搜索代码:
<form id=”search” action=”<?php bloginfo(‘url’); ?>/” target=”_blank”>
<input id=”s” name=”s” maxlength=”30″ style=”vertical-align: middle; margin-bottom:12px;” type=”text” value=”<?php the_search_query(); ?>”/>
<input type=”image” width=”60″ height=”22″ class=”searchaction” onClick=”if(document.forms[‘search’].searchinput.value==’- Search -‘)document.forms[‘search’].searchinput.value=”;” alt=”Search” src=”<?php bloginfo(‘template_directory’); ?>/img/sbtn.gif” border=”0″ />
</form>
<div class=”sform fl”></div>
原文链接:https://i.haogew.cn/198.html,转载请注明出处~~~
评论0