开发者

How to implement a search feature for WordPress CMS?

I need to incorporate a "Search" feature within my WordPress CMS site that I am currently developing and was hoping to attach 开发者_JAVA百科this feature/plugin to the following piece of code and unsure how to do this in WordPress, i.e.:

            <div id="search_box">
              <form method="get" action="/search" id="form">
                <input name="white_box" type="text" class="search" value="Search site" size="19" maxlength="80" id="white_box" onfocus="if (this.value=='Search site') this.value = ''"/>
                <input name="submit" type="image" class="submit" value="submit" src="images/search_btn.jpg" />
              </form>
            </div>

I basically want to incorporate a "Search" feature on my site.


@Tonsils you may use any of below ready-to-use WordPress plugins depends on your requirement...

Use Relevanssi Plugin for Multilingual Support http://wordpress.org/extend/plugins/relevanssi/

Use WPSearch for well behave custom Search http://wordpress.org/extend/plugins/wpsearch/

Use Search-Everything for all type of Content Search http://wordpress.org/extend/plugins/search-everything/


This a very basic WordPress search form. See the difference in the form action URL?

<form method="get" id="searchform" action="<?php bloginfo('home'); ?>/">
   <input type="text" size="14" value="<?php echo wp_specialchars($s, 1); ?>" name="s" id="s" class="s" />
   <input type="submit" id="searchsubmit" value="<?php _e('GO'); ?>" />
</form>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜