WP User Manager - WP_Query ordering posts by the most likes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$args = array( | |
'post_status' => 'publish', | |
'post_type' => 'post', | |
'meta_key' => 'wpum_likes', | |
'orderby' => 'meta_value_num', | |
'order' => 'DESC' | |
); | |
$query = new WP_Query($args); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Requires the Likes addon.