admin管理员组文章数量:1419648
I'm building a custom homepage that has that structure:
Cat 1
Post 1 | Post 2 | Post 3
Cat 1
Post 1 | Post 2 | Post 3
etc...
I know how to get all top non-empty categories, loop through them and inside each fetch latest 3 posts. However, that would imply doing as many exdtra DB queries as categories I have, so I think that would not be optimal.
I think I might be able to hack a custom SQL query that fetches that data only, but I want to be able to use recular post code such as <?php the_permalink(); ?>
.
Is there an optimal solution to this?
本文标签: databaseGet all top categoriesthen only 3 posts for each
版权声明:本文标题:database - Get all top categories, then only 3 posts for each 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745315704a2653143.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论