开发者

wordpress custom search for post under selected category

Hi I want to create a custom post search under a particular category. How can I create that.

How to create a cu开发者_如何学运维stom where condition related to that particular category?


You should try hijacking the search results (in search.php) if you have a certain query.

Meaning:

if a category (ID) is sent (perhaps as catID) by the search form together with the usual s variable, do a new query_posts('s=$s&paged...&cat=$catID');.

else just let the internal search take care of the results.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜