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)
- When to use WP_query(), query_posts() and pre_get_posts
- How to Get All Posts with any post status?
- posts_per_page no limit
- Nested meta_query with multiple relation keys
- How can i get count from query post
- query_post by title?
- Why query_posts() isn’t marked as deprecated?
- Alternative to query_posts for main loop? [duplicate]
- how to query posts by category and tag?
- Using WP_Query to Query Multiple Categories with Limited Posts Per Category?
- How to Change Order of Posts in Admin?
- Order by meta value or date?
- How do I query by post format in WordPress 3.1
- Display posts of the last 7 days
- Is there a way to exclude the content from the post variable to save on RAM usage?
- Filtering posts by post meta data
- ORDER BY custom field value
- Sorting: custom query with orderby meta_value_num THEN by title
- Query posts by custom taxonomy ID
- Fail to compare dates in meta_query
- Display/query post formats
- sort child pages on admin
- Custom Table Column Sortable by Taxonomy Query
- Custom search filter causes menu and query_posts problems
- How to query post by user role?
- Using meta_query on pre_get_posts to exclude a particular meta_key value
- Adding meta_key via pre_get_posts causes navigation to disappear
- Changing the meta_query of the main query based on custom query_vars and using pre_get_posts
- Help to condense/optimize some working code
- How to set posts per page using WP_Query()
- query_posts exclude a meta key
- How do I create a random post that will last for a day
- Ensuring sticky posts are retrieved first (without using two queries)?
- Query Multiple Post types each with own meta query
- Determine if more posts are available than was asked for in `query_posts()`?
- Modify main WordPress loop with a parse_query filter
- How to exclude latest x posts from a paginated query?
- query_posts() in function makes global $wp_query out of sync?
- Limiting query_posts to 1, regardless of sticky post?
- How to make “sticky” pages (and query by them)
- 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
- Problem with ‘post__not_in’
- How to order posts by descending comment count on taxonomy page?
- Is it better practice to use query_posts, WP_Query, or get_posts to create various custom loops within a Page?
- WP 5.8 “Query Loop” block: where to place custom query?
- Perform query with meta_value date
- Using is_main_query to select custom post type on certain page
- Custom Post Type “Event”: chronological list of recurring events
- Meta query interfering with orderby relevance
- Meta Query with date and time on the same Day before given time
- using post__in allow duplicate post id
- Pagination on archive.php page
- WordPress Custom Query
- Best way to load page content in Fancybox popup?
- search query within custom taxonomy term, post title and meta field
- How should I intercept the main query and inject custom join / order by / group by criteria
- advice on creating a ‘related posts’ query like the one used on stackexchange
- filter search result with custom post type meta key
- order post my meta value m/d/y format with year as included value
- Order by meta value, pro first, then free
- Having trouble generating pagination links on custom query
- How to create an attachments archive with working pagination?
- _wp_page_template to dynamically use template
- order by meta_value serialized array
- How do I create my own nested meta_query using posts_where / posts_join?
- Meta Query “IN” doesn’t work with ACF checkbox filter
- Using dynamic conditions in ‘posts_where’ filter
- Using Query Posts With Multiple Post Types And A Taxonomy
- Help altering a query to exclude all but standard post format
- Sorting Posts by custom field