【发布时间】:2018-02-24 05:32:45
【问题描述】:
我正在开发一个基本的自定义 WordPress 模板。在这里我有一个这样的搜索表单:
<form class="navbar-form" role="search" method="get" id="searchform" action="">
<div class="input-group">
<input type="text" class="form-control search" placeholder="Search" name="q">
<div class="input-group-btn">
<button class="btn btn-default search" type="submit"><i class="glyphicon glyphicon-search"></i></button>
</div>
</div>
</form>
现在,当我搜索某些内容时,它会转到 home.php 页面(网站主页),但我需要调用 search.php 文件,以便所有搜索结果都会显示在 search.php 文件中。
我目前正在使用的文件列表:
- 404.php 2.footer.php 3.header.php 4.home.page 5.index.php(空)
- page.php 7.search.php 8.single.php 9.style.css 10.screenshot.png
如何在 search.php 页面中显示结果?
注意:WordPress 新手。
【问题讨论】:
标签: wordpress