最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

advanced custom fields - Display Specific Posts at Start of Loop

programmeradmin1浏览0评论

I'm attempting to mimic 'sticky' functionality on a custom post type using a simple ACF true/false field. I'd like to use pre_get_posts to modify my query to first show my 'sticky' posts at the top and then loop through the rest, excluding the sticky ones.

I understand how to exclude posts by ID or by meta value from the query but am stuck on a good way to show the sticky ones first.

Q: what is a logical method for modifying the query using pre_get_posts to show four specific posts before 'the rest'?

发布评论

评论列表(0)

  1. 暂无评论