admin管理员组文章数量:1336602
I don't use The Loop, because I use different queries to fetch posts (I use 3 queries instead of one).
How to disable main query for home, category and search pages?
I don't use The Loop, because I use different queries to fetch posts (I use 3 queries instead of one).
How to disable main query for home, category and search pages?
Share Improve this question asked Sep 28, 2012 at 14:54 StancellStancell 993 bronze badges1 Answer
Reset to default 2This is not trivial, because "home,category and search" are logically determined while main query churns through stuff. I am pretty sure I read this is possible, but that was in context of syndicating site that hadn't used posts/loop at all and scrapped it to do different stuff.
More typical approaches are:
Integrate custom logic into main query, by using
pre_get_posts
,posts_*
and other relevant filters.Leave main query for one of loops and implement other loops as secondary.
本文标签: How to disable main query
版权声明:本文标题:How to disable main query? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742410344a2469659.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论