User & Post Followers as Post Relation

  • Member Access
  • Display voxel followers from post relations. Show the followers profile with simple preview cards.

🔄 Voxel Followers as Post Relations – Setup Guide & Auto-Sync Logic

This function might do only one thing, but it’s not exactly simple. 😅 Let’s walk through both the manual setup and the automatic sync functionality it powers.


📌 Step 1: Setup Post Relations for Followers

👤 In the Profiles post type:

  • Add a Post Relation field named “Followers Relations”

  • Set:

    • Relation type: Has many

    • List type: Select

    • Related to: Profiles

    • Custom relation key: user-relation-followers

🔍 Filtering Setup:

  • Go to Filtering and add a Search Filter:

    • Type: Post Relation

    • Name: Followers Relations

    • Data Source: Followers Relations

    📝 We’ll need this for the feed filter later.

📦 In your other post types (e.g. Listings, etc.):

  • Add the same Post Relation field:

    • Name: Followers Relations

    • Relation type: Belongs to many

    • List type: Select

    • Related to: Profiles

    • Custom relation key: post-relation-followers

💬 Repeat this for any other post types you want to have followers.


🖼️ Step 2: Display Followed Users

To show which users followed a post:

👤 Back in the Profiles post type:

  • Create a Custom Preview Card

    • Show only the Avatar (or add the name if you’d like)


🔧 Step 3: Use the VX Feed to Display Followers

In the “Single Post” template of your post type:

  1. Add the widgets:

    • Post feed (VX)

    • Search form (VX)

  2. Link them together:

    • In Search Form, set:

      • Post type: Profiles

      • Add Profile Filter: Following Relations

        • Set default value:

        • Set value: @post(:id)

        • 🔒 Hide this filter

  3. In Post feed, select the custom preview card you created earlier.

Done! You now have a clean follower feed per post using native Voxel tools. 🎉

This code goes in your functions.php

When the follow action is triggered, the follower will become related to the post as a post relation. 

If you already have followers that are not yet saved as post relations, use this function to trigger the update of all by accessing this URL as Administrator.

https://yourwebsite.com/wp-admin/?update_relations=run

  • UI/UX Designer & Wordpress Developer

Your guide is set up to show followers of CPTs, is there a way to do the same for profiles? So, when a user follower another user (on their profile) then they are displayed on that users profile as a follower?

  • 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

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