Hi, I followed this tutorial to start counting post views in Frontity.
The request in every post view is working fine, however I’m kinda lost as how to return the top 4 most-read posts.
The tutorial final step says “Now it’s easy to make a query for the most popular posts by including ‘meta_key’ => ‘views’ and ‘orderby’ => ‘meta_value_num’ as query arguments.”
But I don’t know how to do this.
I need to retrieve the 4 most popular posts so I can list them in the homepage. It would be good too if I could get only recent (2 weeks ago to current day) posts, to achieve kind of a “trending new posts” effect.
I tried searching the docs but maybe I’m searching for the wrong terms.