开发者

get_search_form(wordpress) in a placeholder web form

I have made a placeholder web form:

<input type="text" value="Search" onfocus="if (this.value == 'Search') {this.value = '';}" onblur="if (this.value == '') {this.value = 'Search';}" >

Now I need to add the Wordpress get_searc开发者_如何转开发h_form code in this to allow this form to search my website. Can you guys please help me out, on how to implement this?

Heres the search.php code: http://i.stack.imgur.com/NfWi0.png


There is also a template file called searchform.php. This is a template file that is often included in the sidebar of many themes and generates the search box form. If there isn't one in your theme, you can easily copy it from the Default theme, Or the code below

    <form method="get" id="searchform" action="<?php echo esc_url( home_url( '/' ) ); ?>">
    <label for="s" class="assistive-text"><?php _e( 'Search' ); ?></label>
    <input type="text" name="s" id="s" placeholder="<?php esc_attr_e( 'Search' ); ?>" onfocus="if (this.value == 'Search') {this.value = '';}" onblur="if (this.value == '') {this.value = 'Search';}" />
    <input type="submit" name="submit" id="searchsubmit" value="<?php esc_attr_e( 'Search' ); ?>" />
</form>
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜