Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
您好我想在特定类别下创建自定义帖子搜索。我怎样才能创造它。
如何创建与该特定类别相关的自定义条件?
如果您有某个查询,您应该尝试劫持搜索结果(在 search.php 中)。
意义:
如果搜索表单发送了一个类别(ID)(可能是catID)以及通常的s变量,则执行一个新的query_posts('s=$s&paged...&cat=$catID');.
catID
s
query_posts('s=$s&paged...&cat=$catID');
否则就让内部搜索处理结果。