Problem:
How to order View results by post stickiness.
Solution:
Because of the way WordPress identifies sticky posts, it is not possible include the stickiness of posts in the ordering options.
Sticky posts are stored in an array in wp_options, so you would need to run your query independent of their stickiness, then use the wpv_filter_query_post_process hook (https://toolset.com/documentation/programmer-reference/views-filters/#wpv_filter_query_post_process) to manually re-order the results by first extracting those that are found in the array of sticky posts and then appending the remaining posts which are not.
This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
- | 7:00 – 14:00 | 7:00 – 14:00 | 7:00 – 14:00 | 7:00 – 14:00 | 7:00 – 14:00 | - |
- | 15:00 – 16:00 | 15:00 – 16:00 | 15:00 – 16:00 | 15:00 – 16:00 | 15:00 – 16:00 | - |
Supporter timezone: Europe/London (GMT+00:00)
This topic contains 2 replies, has 2 voices.
Last updated by 6 years, 10 months ago.
Assisted by: Nigel.