WordPress模板标签the_search_query用于输出搜索关键词,通常用在搜索表单和搜索结果页中。
the_search_query()
该函数没有任何参数,直接调用即可。
函数使用示例
<form method=\"get\" id=\"searchform\" action=\"<?php bloginfo(\'url\'); ?>/\"><div><input type=\"text\" value=\"<?php the_search_query(); ?>\" name=\"s\" id=\"s\" /><input type=\"submit\" id=\"searchsubmit\" value=\"Search\" /></div></form>
扩展阅读
the_search_query()函数位于:wp-includes/general-template.php
相关函数:
- get_search_query()
-=||=-收藏赞 (0)
不要再留垃圾评论了,主题君整理资源不容易,留几句鼓励的话吧。