我如何从 WordPress 中的每个类别中仅获取 1 个帖子
我有一个名为新闻的类别,其中有许多子类别。 我想要做的是从每个子类别(包括类别标题、帖子标题、附件图片)中仅获取 1 个帖子(最新)。 朋友们有什么建议吗??
i have a category named news and many subcategories inside it.
What i wanna do is to get only 1 posts(newest) from each of those sub categories(including category title, post title, attachment image).
Is there any suggestions friends??
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
几个小时后,感谢我们世界各地的同事,我已经能够修改主查询,因此我们甚至不需要使用模板并生成新的查询和循环......
After a few hours and thanks to our fellows all around the globe, I've been able to modify the main query so we don't even need to go the templates and generate new queries and loops...