Support

Account

Home Forums Add-ons Repeater Field Collecting repeater fields from multiple sub-pages

Unread

Collecting repeater fields from multiple sub-pages

  • I have a site that has the following format:

    
    Parent Page (Want to display all child repeaters)
    |
    |___Child Page (Has repeater field)
    |
    |___Child Page (Has repeater field)
    |
    |___Child Page (Has repeater field)
    

    As you can see, I want to display all of the child repeaters (which are the same kind) on the parent page.

    I am guessing that I need to collect all of the child ids in an array and then plop it where $page_id is in the code below, but not sure how to go about doing that. How can I accomplish this, or is there a different/better way to do it?

    
    <?php 
    global $post;
    $page_id = get_queried_object_id();
    
    if( have_rows('faq_section', $page_id) ): ?>
    
        <?php while( have_rows('faq_section', $page_id) ): the_row(); ?>
    
             ----Repeater Stuff----
    
        <?php endwhile; ?>
        <?php wp_reset_postdata(); ?>
    <?php endif; ?>
    
    
Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.

We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.