广告位招租

十、添加搜索框功能search.php和文章浏览量功能

添加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(‘ &mdash; ‘); 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>

资源下载
资源下载
0
广告位招租

评论0

广告位招租
没有账号? 注册  忘记密码?