admin管理员组文章数量:1130349
I have a need to sort the search results so that a custom post type "authors" is always at the top, followed by all other post types sorted by relevance.
I've found numerous examples about altering the query for one or the other of these two conditions but not both together.
THe issue is that sorting for one post type needs to happen in the mySQL, while a sort by relevance is a WordPress function. I'm not seeing a practical way to get both in the same filter.
Thanks!
I have a need to sort the search results so that a custom post type "authors" is always at the top, followed by all other post types sorted by relevance.
I've found numerous examples about altering the query for one or the other of these two conditions but not both together.
THe issue is that sorting for one post type needs to happen in the mySQL, while a sort by relevance is a WordPress function. I'm not seeing a practical way to get both in the same filter.
Thanks!
本文标签: How to use multiple orderby conditions on query search results (orderby one post typerelevance)
版权声明:本文标题:How to use multiple orderby conditions on query search results? (orderby one post type, relevance) 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://it.en369.cn/questions/1749077097a2312470.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。


发表评论