🔗 Displaying ACF Relationship Fields in Divi Query Builder
Posts, Users, Terms, and Links — Fully Dynamic with Divi Query Builder
ACF Relationship fields are essential for building relational content structures in WordPress. Whether you’re linking courses to instructors, products to categories, or team members to departments, Divi Query Builder makes it easy to display this data dynamically — no custom PHP required.
Let’s walk through how to use each supported field type and what kind of output Divi Query Builder can generate.
🧩 Supported ACF Field Types
Divi Query Builder supports the following ACF field types natively:
Field Type | Returns | Display in Query Builder |
---|---|---|
post_object | Single post object | Title (linked), Excerpt |
relationship | Array of posts | Title (linked), Excerpt |
user | WP_User object | Display Name (linked), Bio |
taxonomy | Term object | Term Name (linked), Description |
page_link | URL to a page/post | Anchor tag with label |
link | URL + label | Anchor tag with label |
🔧 Step 1: Set Up ACF and Divi
Ensure the following are active:
- Advanced Custom Fields Pro (for Relationship fields)
- Divi Theme + Divi Query Builder
✍️ Step 2: Create Your Field Group
Go to Custom Fields > Add New and add one or more of the following:
post_object
: Link a single post (e.g., featured article)relationship
: Link multiple posts (e.g., related products)user
: Link authors, team members, or clientstaxonomy
: Link categories, tags, or custom termspage_link
: Link to internal pageslink
: Link to external URLs with custom labels
Assign the field group to the relevant post type.
🌀 Step 3: Populate Your Fields
Edit a few posts and fill in the relationship fields with real data. For example:
- On a “Course” post, select multiple “Instructor” users
- On a “Product” post, link to related “Category” terms
- On a “Team Member” post, add a
page_link
to their bio page
This creates the relational data that Divi Query Builder will display.
🧱 Step 4: Build Your Loop with Divi Query Builder
- Add the Divi Query Builder module to your layout.
- Set the Post Type to the one containing the relationship fields.
- Enable Show Custom Fields and add the relevant field tags.
Divi Query Builder automatically detects the field type and renders the appropriate output.
👀 Step 5: Save and Preview
Save your layout and preview the page. You’ll see each post dynamically displaying its related content — whether it’s linked posts, user bios, taxonomy terms, or external links.
🚀 Bonus Use Cases
- Course Page: Show instructors (user field), related modules (relationship), and syllabus download (link field)
- Team Directory: Display department (taxonomy), bio page (page_link), and LinkedIn profile (link)
- Product Page: Show related products (relationship), category (taxonomy), and support contact (user)
0 Comments