Created
March 22, 2017 18:07
-
-
Save web-hat/4b5b3a7cb4141178ec22b08197306b13 to your computer and use it in GitHub Desktop.
Display Popular Posts by Views in WordPress without a Plugin
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 = [ | |
//... | |
'meta_key' => 'whpp_track_post_views', | |
'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