1. Home
  2. Docs
  3. Divi Extended Loop
  4. Settings
  5. Nested Loops

Nested Loops

The Nested Loops feature in the Divi Extended Loop plugin allows a child loop to dynamically capture the current ID, post, term, or author from a parent loop. This unlocks powerful relational data structures—such as displaying ACF/SCF relationships, child terms, author-specific posts, or related taxonomies—directly tied to each item in the parent loop.


How Nested Loops Work

When building complex layouts using the Divi Builder (such as a Loop Builder or Query Grid), standard loops operate in a global context. By enabling Nested Loops, the inner loop inherits context from the current iteration of the outer (parent) loop.

Depending on your data architecture, the child loop can dynamically query:

  • ACF/SCF Relationships & Post Objects from the currently looped post.
  • Posts belonging to the current term in a term loop.
  • Posts authored by the current user in a user loop.
  • Terms or Author details linked to the parent item.

Configuration Guide

To set up a nested loop inside your Divi layout:

  1. Set your parent loop module/row (e.g., displaying a grid of Posts, Terms, or Users).
  2. Inside the parent item template, activate your child loop on any loop compatible module.
  3. Navigate to the Extended Loop tab and toggle on Nested Loop.
  4. Choose the appropriate Extended Post Query Type based on the relationship you want to display:
    • All ACF/SCF query types: Pulls related posts dynamically from a looped post/term/user using an Advanced Custom Fields or Secure Custom Fields field name (e.g., acf_post_object).
    • Looped Term Posts: Displays posts associated with the current term of the parent loop.
    • Looped User Author Posts: Displays posts written by the author of the currently looped post.
    • Post Terms / Post Author: Dynamically pivots to display taxonomies or author metadata attached to the parent looped post item.

Common Use Cases

  • Dynamic Project Galleries: Displaying a nested grid of project assets or related case studies attached via an ACF relationship field on the parent post.
  • Author Archives within Loops: Showing a mini-bio and recent posts for each author listed in a custom user query loop.
  • Hierarchical Taxonomies: Listing child terms or related category items dynamically relative to the parent term loop context.
Divi Extended Loop Nested Loop

How can we help?