We've added a new query type to the Max Query Loop: Most Viewed Posts!
As the name suggests, this query option allows you to showcase your most viewed posts anywhere on your website.
Before You Start:#
Make sure you've installed and activated the Post Views Counter plugin. You can easily install the free version right from your website's dashboard.
Let's Get Started:#
- Start by editing your existing Single Post Template. If you prefer, you can also create a new page and save it as a template later. Once you're in there, hit the 'Edit with Bricks' button.
- Drop in a "Container" element on your page and toggle on the 'Query loop' option.
- Once you enable the query loop, a drop-down menu will appear. From there, choose 'Max Query.'
- Under Max query type, select 'Most viewed posts' from the drop-down menu.
- Next, set the Post type to "Posts" to make sure you're showcasing blog posts.
- You can define the number of posts you want to display in the Posts per page option.
- In the Order option, you get the flexibility to choose whether your posts appear in Ascending or Descending order.
And that's it! You've just used the Max Query Loop to display your most viewed posts. Hope this helps :)