45
votes
Advanced Query Loop Block - Order by Custom Field Value
I published this comment on the blog post about the new Advanced Query Loop block (https://www.kadencewp.com/blog/coming-to-kadence-blocks-pro-advanced-query-loop/), but wanted to make sure I submitted a formal feature request as well. Here's my comment from the blog post:
Loving this new block! I'm currently implementing it for a client's grid of staff members that needs to be ordered by seniority (who has worked there the longest), and I realized a feature I'd like to see added to the plugin. In GenerateBlocks, you can order a query loop by custom field value: https://docs.generateblocks.com/article/order-query-loop-by-custom-field/
This would be great for setting an explicit order for the query results not available in the current options of alphabetical ordering, date added/modified, menu, and random order. I'd love to be able to use a custom field value such as "start date" for a staff member. Or maybe just assign a numerical value representing their hiring order. In either case, the oldest date or lowest value would correspond to hiring order and the query loop would be ordered exactly as I want it.
Unfortunately, in this particular use case – simply going off of the original published date won't work as the client has "repurposed" some former employee's CPT items, so all current employees' published custom post type date isn't synonymous with their "start date" if that makes sense.
For now, I'm just going to modify the published dates to get the ordering in the proper sequential order. Altogether, I'm loving this update. Way to go Ben and team!
One Comment
Leave a Reply
You must be logged in to post a comment.



Just tried to do this… surprised this feature isn’t available.