Skip to content

Commit

Permalink
fix: inaccurate count when sorting by most viewed (resolves #238)
Browse files Browse the repository at this point in the history
  • Loading branch information
greatislander committed Mar 31, 2020
1 parent f320603 commit f7262f2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/Controllers/App.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public function currentLanguage()
return 'en';
}

public function foundPosts($lang = 'en')
public function foundPosts()
{
global $wp_query;
return $wp_query->found_posts;
Expand Down
2 changes: 1 addition & 1 deletion app/filters.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
'posts_per_page' => -1,
'fields' => 'ids'
]);
$ids = array_merge($viewed_ids + $unviewed_ids);
$ids = array_merge($viewed_ids, $unviewed_ids);
$query->set('post__in', $ids);
$query->set('orderby', 'post__in');
break;
Expand Down

0 comments on commit f7262f2

Please sign in to comment.