admin管理员组文章数量:1425245
I'm taking my first steps in wordpress, pretty newbie. and I find that I want to make a search form with its own styles and a little javascript to redimension. So I do not know how I should proceed in several ways.
Is it better to use the get_search_form () method, inspect and change their styles? like for example the search-field class or for html5 searchform?
OR
Is it better to make my own form from scratch if it is going to have (many) changes?In the case that it is better to use get_search_form (), I inspect and change the styles directly? or do I support html5 and change the styles of these? Or is there a way to embed additional classes to the said form?
in the case that it is better to make my own form as I do so that wordpress detects it as a search form? or that failing to do the search?
I'm taking my first steps in wordpress, pretty newbie. and I find that I want to make a search form with its own styles and a little javascript to redimension. So I do not know how I should proceed in several ways.
Is it better to use the get_search_form () method, inspect and change their styles? like for example the search-field class or for html5 searchform?
OR
Is it better to make my own form from scratch if it is going to have (many) changes?In the case that it is better to use get_search_form (), I inspect and change the styles directly? or do I support html5 and change the styles of these? Or is there a way to embed additional classes to the said form?
in the case that it is better to make my own form as I do so that wordpress detects it as a search form? or that failing to do the search?
1 Answer
Reset to default 2When you code get_search_form()
WP search searchform.php in your theme root and print all inside that file.
And you can create searchform.php inside your theme root and insert this:
<form role="search" method="get" action="<?php echo home_url('/'); ?>">
<fieldset>
<input type="text" name="s" value="<?php the_search_query(); ?>">
<button></button>
</fieldset>
</form>
That basic search form.
Then code <?php get_search_form() ?>
where you want this form in your theme. You can add your own class or ID inside that form and change what you want. Also I put link for couple notes about search_form
本文标签: How to make a search form
版权声明:本文标题:How to make a search form? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745440333a2658417.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论