Title: nested loops?
Last modified: April 9, 2017

---

# nested loops?

 *  Resolved [mazoola](https://wordpress.org/support/users/mazoola/)
 * (@mazoola)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/nested-loops-2/)
 * I see half of my question is answered in 1.1.29: The To-Do entry concerning looping
   through attachments using apr_loop. Is there currently, or do you anticipate 
   there being, any way to nest loops?
 * For instance, I have a Virtual Post defined using ‘FIND(‘$1′,genre) > 0’ as its
   filter. It maps to a page containing a field-less [apr_loop], resulting in a 
   list of all records whose ‘genre’ (a multi-select) contains ‘$1’. For each record,
   I’d like to be able to loop through its ‘images’ field to display thumbnails 
   for, say, the first 5 images. I’ve not been able to find a way to loop through
   a field within a record-by-record loop.
 * Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [Chester McLaughlin](https://wordpress.org/support/users/chetmac/)
 * (@chetmac)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/nested-loops-2/#post-9011002)
 * Just pushed out 1.1.30 which fixes nested loops. I haven’t tested with anything
   other than linked records and attachments yet. And while it should theoretically
   work for up to 10 nested loops, I haven’t tested it that deep.
 * Thanks for the feedback, and let me know how it works for you!
 *     ```
       [apr_loop]
         {{Name}}
         [apr_loop1 field="Pictures"]
          {{thumbnails|large|url}}<br>
         [/apr_loop1]
       [/apr_loop]
       ```
   
 *  Thread Starter [mazoola](https://wordpress.org/support/users/mazoola/)
 * (@mazoola)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/nested-loops-2/#post-9011313)
 * Thanks! Works great with the couple of test cases I’ve thrown at it so far.
 * (Ten deep, eh? This could be fun…)
 * Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘nested loops?’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/airpress_c9d28c.svg)
 * [Airpress](https://wordpress.org/plugins/airpress/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/airpress/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/airpress/)
 * [Active Topics](https://wordpress.org/support/plugin/airpress/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/airpress/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/airpress/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [mazoola](https://wordpress.org/support/users/mazoola/)
 * Last activity: [9 years, 1 month ago](https://wordpress.org/support/topic/nested-loops-2/#post-9011313)
 * Status: resolved