Not display posts with 0 views
-
Hi,
I have manually added a code to sort the posts by popularity.
Here is the code for the sort by popularity.
if ($_POST[‘sortby’] == ‘bypop’) {
$query_args = array(
‘category_name’ => $current_category,
‘showposts’ => 12,
‘meta_key’ => ‘views’,
‘orderby’ => ‘meta_value_num’,
‘order’ => ‘DESC’,
‘paged’ => $paged );
}$wp_query = new WP_Query();
$wp_query->query($query_args);The problem is that, it doesn’t show posts with 0 views. It will only display posts that has views. How can I display all of the posts including posts with 0 views? Thanks.
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Not display posts with 0 views’ is closed to new replies.