The other day I was thinking on how to make something like this, I would recommend to save the hottnes as a post meta value, that is updated on every vote, save or update, for that you will need the save_posts filter and then you can get the posts ordered with pre_get_posts and a meta query something like
$query->set('meta_key'=>'hottnes');
$query->set('orderby'=>'meta_value_num');
$query->set('order'=>'DESC');
Hope this helps.
Related Posts:
- How to query_posts using meta_query to orderby meta_key AND have a secondary sort by date?
- Sort Posts by Multiple Meta Values [duplicate]
- Tax query get first product with attribute value in pre_get_posts
- Using meta_query, how can i filter by a custom field and order by another one?
- How to return results of a get_posts() in explicitly defined order
- Sort posts alphabetically by custom field value, insert divider between different letters
- Sort X categories by last update and show image
- Sorting problem with ‘query_posts’ funcion in wordpress. Sort by custom field not working
- Replace query_posts with pre_get_posts
- query_posts sort in multiple directions
- get_post_meta causes database queries
- Order by meta_key with two meta_queries
- ACF Custom Field WP_Query, but need to get all posts, if field doesn’t exist
- Order posts using a custom array
- orderby:date not working
- Single meta key with multiple meta value in like comparison
- Help ordering Post loop by two meta values
- number of posts per page + random + exclude categories
- Filter Loop by Custom Field Value
- meta_query check for meta value in key which holds an array of values
- Sorting search results with custom dropdown
- Meta query stopped working
- Custom query looking at multiple custom fields and properly sorting
- Ordering Posts By Meta Data
- query_posts() with multiple meta data comparisons
- why is pre_get_posts not working
- wp_query by last month + sort posts
- If meta_key has value = 6 | Change the wp_posts.post_date to current date
- Custom taxonomy with custom meta value is not sorting correctly (query returns the same value for orderby regardless of sort column click)
- posts_per_page no limit
- ORDER BY custom field value
- Sorting: custom query with orderby meta_value_num THEN by title
- Query Multiple Post types each with own meta query
- Query posts: how to exclude results if post is in multiple categories
- query_posts ->using meta_compare / where meta value is smaller or greater or equals
- WP 5.8 “Query Loop” block: where to place custom query?
- Meta Query with date and time on the same Day before given time
- Pagination on archive.php page
- order post my meta value m/d/y format with year as included value
- _wp_page_template to dynamically use template
- Meta Query “IN” doesn’t work with ACF checkbox filter
- Schedule Sticky Posts
- Advanced orderby with multiple meta_query
- Problem with single-page for my custom post
- How to sort posts in admin by titles with dd.mm.yyyy format?
- How to make the list of post and load on same page with sub-pages [closed]
- Sortable admin column for one meta key with three possible meta values
- post_status => publish not working
- How to fetch all posts in a category that were published between two given dates?
- get_meta_data within a loop
- how to exclude “featured” posts from the main loop?
- pass query string on url to filter media
- Order posts by condition
- Co-authors plus problems with query_post
- Error sending array of inputs
- Custom MySQL Query with logic
- Search breaks when querying main loop for category
- How to display multiple custom fields with the same meta_key in an ascending order?
- Sort the result of the main Query in shop page by a custom taxonomy
- How to exclude latest x posts from a paginated query?
- Sanitize Custom Field Value in Meta Query
- Adding conditional content to single post-type template
- Query posts by meta_key whose value is an array
- WordPress Screwing Up ‘orderby’ => ‘meta_value_num’ in ‘pre_get_posts’
- Currently using a query_posts() in my theme – want to use a request filter in stead
- Breadcrumbs stop working on a specific template file
- change the default order of posts only for specific categories
- Meta_query ‘compare’ => ‘LIKE’ not working?
- Custom query filter by ACF date custom field
- Order for custom field after the loop
- Custom post query error
- Why doesn’t my WP Meta Query return any results?
- Multiple instances of query_posts
- Different layout based on post amount?
- If Query Post Returns 1 Post
- Keeping get_posts’ offset and is_paged() synchronized
- odd behaviours from template tags
- How to get any type posts include attachments by ids?
- Create a Loop with Posts Ordered by Most Recent Comments
- How to order query results based on if a custom field has been populated, then the order by the date of the post?
- Sort categories by custom field in WordPress admin
- Order column custom date using pre_get_posts
- Specifying image size used in template the_content
- allow user to edit posts made by others users based on the user role
- Pagination not working on my archive page for a custom post type
- Custome column sort by date not title
- WP search in metadata post
- Order posts by ACF checkbox
- query_posts with sorting on a custom datestamp
- Post per page not working
- Show previous month’s posts
- query_posts result differs from wp_query request result
- Collect posts from last 48 hours
- How to go to tag archives using a form
- WordPress loop problem: Multiple loops, index.php and is_paged causing duplicate posts on next page
- Sorting not working with get_posts
- Sort posts with multiple meta_keys
- Create “archives by year and week” by category template
- ‘Active lotteries’ only custom query for woocommerce lottery plugin and elementor
- WP Query – Show custom posts only if user contain some user meta