🔄 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:
-
Add the widgets:
-
Post feed (VX)
-
Search form (VX)
-
-
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
-
-
-
-
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. 🎉
Update at Follow Action
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
No results available
Reset