There is a nonhierarchical custom post type "news".
/news/
/news/page/2/
/news/post_slug/
Each post has custom field "views"
. When someone opens post, field's value increased by one.
Would like to sort posts by this custom field, by its value.
/news/
/news/views/ = /news/?sort=views (get posts with custom field "views" and sort asc)
/news/views/page/2/ = /news/?sort=views&page=2 (similar to previous, next page)
/news/post_slug/
Got working /news/?sort=views
, but this link is not human-like.
It should be transformed to /news/views/
and be able to handle pagination.
How can we do this?