The Repeater element allows you to visually build loops in Oxygen using a post query or an ACF repeater as your data source.
Add a Repeater to your page from +Add -> Helpers -> Repeater.
The query selects which posts will be displayed by the Repeater element.
The default query is generated by WordPress based on the URL you visit. Visiting the URL for your blog post archive will make WordPress generate a query that will return your blog posts. Visiting the URL for a real estate listing will make WordPress generate a query that will return that real estate listing.
This is all done automatically by WordPress.
You can override the default query by choosing custom or manual.
- Post Type - choose the post types returned by the query, or manually specify IDs
- Filtering - exclude posts that don't match the specified author or taxonomies
- Order - the order the posts are displayed in - alphabetical, by date, etc.
- Count - the number of posts to return
For complete control over the posts returned by query, you can manually specify WP_Query parameters.
Use ACF Repeater
If your post type is using an ACF repeater, select the "ACF Repeater" box which will then show the available ACF field groups.
Select "Stack Child Elements Vertically" for a vertical layout and "Stack Child Elements Horizontally" to have the repeated fields on the same row.
- Normal Mode - Shows all the posts in the builder that are fetched by the query
- Single Mode - Shows a single post in the builder
USING THE REPEATER
The Repeater contains a div element, which can be styled to create both horizontal and vertical layouts. You can add elements to the Repeater div to build your layout. These elements will be repeated for each post returned by your query.
To create a 3 column layout, add the Columns element to your Repeater div by clicking +Add -> Basics -> Columns and set the number of columns required. Add the post title by clicking one of the column divs and adding a Heading element by clicking +Add > Basics > Heading. Double click the heading and select Insert Data -> Post > Title. This will dynamically insert the post title for every row in your repeater. You can repeat this process for other elements (such as Images and Content) to build your repeater.