Filter posts by views

  • FREE
  • Allow visitors to sort your posts by number of views, here’s a simple way to make it happen without any complex plugin.

How to Make “Post Views” a Sortable Field in Voxel

If you want to allow visitors to sort your posts by number of views, here’s a simple way to make it happen without any complex plugin.

✅ First, create a number field for your post type fields:

  • Field name: Post Views

  • Field key: post_views

✅ Next, go to Filters → Search order inside Voxel and add a Custom Order:

  • Type: Number Field

  • Field: Post Views

✅ Now for the magic: let’s automatically sync the real view counts into that post_views field every few minutes.

You just need to add this small function inside your Child Theme’s functions.php or with a plugin like WPCode to insert it as a Snippet.

What does this function do?

  • It reads the real number of views from Voxel’s internal voxel:view_counts.
  • It writes the total view count into your post_views number field.
  • It automatically updates every 10 minutes (no need to manually refresh or re‑save posts).

*Make sure to change “component” with your own post type key name*

  • UI/UX Designer & Wordpress Developer

No results available

Reset
  • Other Resources

Live check for new Notifications and Messages in Voxel. Updates live the page title (X), favicon and the bell/inbox icons.

Looking to drop custom scripts without editing your theme’s files? 📌 WPCode Lite lets you paste any snippet—HTML/JS/CSS/PHP—directly into your site’s global header, body, or footer, all from one streamlined settings page.

  • Third-party
  • 1

Essential Addons for Voxel is one of the smartest plugin buys if you’re serious about growing a Voxel-powered project. It fills the gaps Voxel leaves — without slowing your site down or breaking the spirit of the theme.

  • Third-party
  • 4