I believe you will not be able to do so just with the WP Query/get_posts interface. There is probably an way using a custom MySQL query, but there is another approach you can try. Since you have a custom meta views, you can try create a new custom meta popularity, which will be the sum of views and the comment count. You can hook this in the same views hook, and in the comment_post hook. After that, just query the popularity meta.
Related Posts:
- WP_Query – Order results by meta value
- ORDER BY custom field value
- Sort posts by custom field numeric value using dropdown
- Trying to perform complex custom field query with order by set to field value
- Order Posts by Closest Numeric Values
- Is there a way to do multiple ordering on a multiple meta_query?
- Order by custom field date with ASC order
- Order Custom post type loop by custom field (datepicker)
- Sorting within nested queries / multiple meta keys
- Ordering posts by anniversary using only day and month
- Order by Custom Field date not recognized
- Comments form custom fields order
- If value present, order posts by two consecutive custom fields
- Sorting posts by multiple values, combined
- Sorting posts by custom fields in meta_query
- Order RSS content by an advanced custom field value
- Alter main archive, to show posts with meta as last
- Trying to sort and display categories(not posts) by custom field: ‘order’
- Change order of posts
- Meta query with multiple custom fields for archives page ordering problem
- Ordering posts by custom field named “date” in backend
- query posts custom field calculation value
- WP Query – Is this correct?
- Using abs() with custom field in orderby statement
- ORDER BY custom field value out of where clause
- Sortable Custom Columns not sorting correct
- Order custom fields alphabetically
- Ordering by ‘Title’ OR ‘Custom Field’
- Problem with writting correctly a query posts args in WordPress
- How to query posts by month based on date custom field?
- Ordering by ACF custom field vaule
- Sort by an ACF field in a tax_query
- WordPress Admin – Automatically Sort Custom Posts by Custom Field Date Value in d-m-Y Fomat
- (woocommerce) How to get product id form order id & then retrieve custom meta linked to product?
- Order a query by meta_value and then by post_date
- Order by custom field in query multiple
- Can’t sort custom column on user.php by number / meta_value_num?
- Is there a way to get protected meta fields through any of the available built-in WordPress APIs? (xmlrpc, wp-json)
- add meta box – custom field : which to choose?
- How to use custom fields in post title?
- Custom fields PHP foreach loop
- Show links to archive pages based on custom field values
- Date, Time, and Timezones
- Add custom option to Standard Page Attributes Meta Box
- importing data from non-wordpress mysql db
- Call a custom field in an audio shortcode?
- checkbox in post add/edit to add/remove the post from menu
- How to add a predefined custom field without using a plugin?
- ACF won’t load from a custom JSON location
- PODS performance vs custom field
- Custom Fields with get_post()
- How do you create dynamic customised sections in WordPress?
- how can i stop custom fields that have apostrophes from breaking my code
- WP Query Returning All Posts
- WordPress User Profile Upload – If page is saved file reset
- How to add field above password section in profile page
- How can I store a file in the database in the same way WordPress and ACF do?
- Custom Field Create Bulk via SQL Query
- Show values of dynamically created custom meta keys
- List taxonomy term “Last Name” + “First Name” (taxonomy custom field) in a post loop
- Filter by custom field (meta_key) using JSON API
- Should custom meta boxes be able to output shortcodes the same as WordPress’ native post editor?
- Custom fields value
- How do I have WP_Query match posts based on search parameter OR meta fields? (rather than search parameters AND meta fields)?
- Want to make A CSS if meta key value is empty
- More efficient to add content to custom fields or the content area?
- Custom field query without duplicates results
- how to display an excerpt of the latest post on the homepage?
- Add a custom meta box for client to order CPT posts how they want
- querying a custom field
- Custom post type missing custom fields
- Problem with saving large amount of data in postmeta/usermeta
- meta_value and meta_key filtering returning no posts [closed]
- Woocommerce Retrieving custom field value from orders
- If metabox has content display content
- How to change permalink on headlines in rss feeds?
- Listing the most popular 8 city (custom fields) as used in posts
- How to delete file uploaded by Plupload
- Display Meta Data with HTML?
- Displaying custom field meta within WP_query loop
- Display the output from Custom User Fields from a WordPress user profile on a WordPress Custom Page
- Meta field bulk editing no longer working in WP 6.0 [closed]
- get_field values for each post on home page using wp_add_inline_style
- Delete user meta but only if found in array
- Is there a way to determine which user changed a custom field (and when)?
- Metabox/Custom fields are not saving input data
- meta_query to check all custom fields
- Show echo ready in single.php
- Save, update, get and sanitize post meta as HTML not plain
- Order categories by sum of custom fields
- how to modify a field’s size in a metabox : ROWS height, and scroll control?
- Saved Post Meta Array Returns as String
- Empty the_content for all posts
- Display different category template if custom field is checked
- Show message if statement is false – foreach
- Echo text if field under user_meta is empty with get_users()
- Filtering posts by WORD in custom field
- Truncating characters in Advanced Custom Fields works some places but not others?
- Conditional display based on ACF checkbox
- How to add an ACF only for parent term?