A dynamic blog grid needs two problems to art work smartly together: content material subject material that can industry and a construction that can keep up with it. New posts get published, categories increase, and the choice of items returned by the use of a query changes over time. The aim is to build the card and the surrounding building once, then let the device deal with what comes next.
That’s where 3 Divi 5 choices art work specifically smartly together. The Loop Builder supplies and repeats the content material subject material. CSS Grid controls how those repeated items are arranged. And the new Grid Editor gives you a visual way to shape that Grid, in conjunction with further difficult repeating patterns with Grid Offset Regulations.
In this tutorial, we’ll assemble one dynamic blog card, turn it proper right into a Loop, place those repeated taking part in playing cards inside a CSS Grid, and then use the Grid Editor to create 4 further inventive Loop layouts.
What Are Loops?
A Loop displays a changing choice of content material subject material using one repeated design. Instead of manually creating a card for every blog post, product, Problem, author, or other get admission to, you design one products and let WordPress give you the content material subject material that belongs in each repetition.
Divi 5’s Loop Builder brings that workflow into the Visual Builder. You choose the phase you wish to have to replicate, configure the query that determines what content material subject material must appear, and then connect modules throughout the repeated building to Loop Dynamic Content material subject material.
That changes the best way you handle a dynamic internet web page. Instead of bettering specific particular person taking part in playing cards every time content material subject material changes, you prepare the repeated design and query. Put up each different matching post and the Loop can include it robotically. Change the card template and the repeated items observe the identical design.

Loop Builder is helping much more than standard blog posts. Depending on the Query Type, Divi can loop through posts and custom post types, words, shoppers, and supported custom-field data. For this tutorial, we’ll keep problems simple and assemble a post-based blog Loop.
What Is CSS Grid?
CSS Grid is a two-dimensional construction device built spherical rows and columns. You define the Grid on a parent container, then the child items go with the flow into the tracks created inside it.
That container-based building is especially useful when the youngsters are dynamic. The Grid doesn’t need to know the identify or image inside each post card. It most straightforward should know how many columns the construction uses, how tracks must size, how so much space sits between them, and whether or not or no longer certain positions must span or switch another way.
As Loop items are generated, CSS Grid places them into the available building. If each different products is added, it continues into the next available Grid position consistent with the construction laws you created.
Why Use CSS Grid For Loops?
Loops and CSS Grid treatment different parts of the identical drawback. The Loop determines which content material subject material is returned and repeats your products template. Grid determines how those repeated items are arranged.
That separation is useful because the Grid commonplace sense lives on the parent container quite than on each specific particular person Loop products. The content material subject material throughout the taking part in playing cards can industry while the surrounding building stays consistent.
A three-column blog Grid, for example, does not need 3 manually created post taking part in playing cards. One looped card can generate all of the results, while the mummy or dad Grid places those repetitions into 3 columns and continues growing rows as necessary.
The combination gets a lot more interesting when Grid Offset Regulations enter the picture. Instead of requiring every Loop products to occupy the identical shape, you’ll be capable to objective positions very similar to the principle products, even or strange items, every third through every tenth products, or a practice nth-child construction and gives those positions different spans or placements.
CSS Grid And The Grid Editor In Divi 5
Divi 5 brings CSS Grid into the Visible Builder. A Section, Row, Column, or Personnel can use Grid as its Construction Style, giving you controls for columns, rows, track sizing, gaps, route, density, alignment, justification, and additional without having to jot down down the Grid CSS yourself.
This container-based method pairs naturally with Loop Builder. Permit a Loop on a child phase and each repeated instance flows into the Grid defined by the use of its parent.
What Is The Grid Editor?
The Grid Editor is the visual interface for Divi 5’s Grid device. Once an element uses Grid as its Construction Style, you’ll be capable to open the Editor as a floating canvas and see the rows, columns, gaps, items, and Offset Regulations you’re running with.
Instead of relying most straightforward on numerical settings, you’ll be capable to drag Grid traces to resize tracks, drag the spaces between tracks to switch gaps, switch items between cells, and pull an products’s corner handles to make it span additional rows or columns.
The Grid Editor is also a visual front end for Grid Offset Regulations. Whilst you switch or resize an products on the canvas, Divi creates the corresponding placement rule for that position. You’ll be capable to then open the rule and change its Purpose Offset if you wish to have that exact same conduct to replicate across the Loop.
That distinction is important for the layouts we’ll assemble later. Dragging one card gives you a at hand information a coarse visual place to begin. Bettering the following rule allows you to turn that one-off placement proper right into a construction very similar to Even Items, Every third Products, Every sixth Products, or a practice nth-child collection.
How To Assemble A Grid Loop
A Grid Loop is available in mixture in 3 hooked up layers. The repeated card determines what each outcome turns out like. The Loop Query determines which content material subject material fills those taking part in playing cards. The mother or dad Grid determines how the repeated items are arranged.
We’ll assemble them in that order, then use the Grid Editor to turn the elemental feed into something further inventive.
1. Assemble A Development Card
Get began by the use of designing one complete post card with placeholder content material subject material. Construction the article previous than enabling the Loop gives you a clear view of its spacing, typography, image treatment, and overall proportions.
Add a Row to the internet web page and use a single Column for the card.

All through the Column, add an Image Module, a Heading Module, two Text Modules, and a Button Module. Style the card now, in conjunction with its typography, colors, spacing, borders, and button treatment. You’ll be capable to moreover connect ceaselessly reused values to Design Variables so the card stays hooked up to the wider web site design device.

If the Loop will use Featured Pictures from different assets, give the Image Module a continuing frame. Open Design > Sizing and set an Aspect Ratio.

We’re using 3:2 for this blog card because it provides a quite huge image area without making the taking part in playing cards excessively tall. If the availability footage use different proportions, open Design > Framing and set Object Have compatibility to Quilt so each image fills the frame without being stretched.
2. Permit The Loop Builder
With the trend card designed, select the Column that contains it and open its settings. Cross to Content material subject material > Loop and make allowance Loop Part. The query controls appear underneath.
Set Query Type to Submit Varieties, choose Posts for the reason that Submit Type, and configure the rest query settings consistent with the feed you wish to have to build.

Now trade the placeholder content material subject material with Loop Dynamic Content material subject material. Open the Image Module, hover over the Image topic, click on at the Dynamic Content material subject material icon, and select Loop Featured Image.

Connect the rest modules within the identical method:
- Image Module: Loop Featured Image
- Heading Module: Loop Submit Identify
- First Text Module: Loop Put up Date or each different piece of post metadata used by your card
- second Text Module: Loop Excerpt
- Button Link: Loop Link
You’ll be capable to moreover assign Loop Link to your whole Loop container when you wish to have the entire card to be clickable.

As quickly because the entirety is connected, preview the internet web page. Divi repeats the Column for the posts returned by the use of the query, with each instance receiving its private image, identify, metadata, excerpt, and link.
3. Turn The Mother or father Row Into A Grid
Now we’ll control how those repeated Columns are arranged. Open the mummy or dad Row settings, transfer to Design > Construction, and set Construction Style to Grid.

Once Grid is vigorous, click on on Open Grid Editor. The Editor opens as a floating panel that can stay visible whilst you continue running throughout the Visual Builder.

Set the Grid to 3 columns. Let the repeated items generate the additional rows they would like, and keep the Row Heights on Auto till the design calls for a singular track-sizing methodology.

Next, modify the horizontal and vertical gaps. Somewhere spherical 20px to 30px works smartly as a place to begin for a lot of card layouts, then again use the associated fee that fits your design device.

Close the Grid Editor and preview the internet web page. The one Loop card is now being repeated proper right into a three-column Grid.

Assemble Fancy Loop Grids With The Grid Editor
The basic Grid gives every Loop products the same amount of space. Grid Offset Regulations imply you’ll be able to destroy that uniformity intentionally by the use of all for explicit positions and changing their Column Span, Row Span, starting position, or other Grid properties.
The easiest workflow is to create the initial variation visually. Drag a card throughout the Grid Editor until it has the shape you wish to have, then open the rule Divi creates and change its Purpose Offset when the treatment must repeat.
The 4 examples below use that way to create different sorts of visual rhythm.
1. The Bento Box
A Bento Grid mixes another way sized taking part in playing cards within of 1 structured construction. A larger anchor card creates the initial focal point, while smaller and taller taking part in playing cards spherical it prevent the feed from feeling like a typical uniform archive.
This works in particular smartly for editorial pages, portfolios, and blog feeds where some positions must lift further visual weight than others.
Get began with 3 columns. Throughout the Grid Editor, drag the principle Loop products until it spans 2 columns and 2 rows. Because the Grid Editor shops this placement at the container level, Divi creates the corresponding Offset Rule without changing the true Loop card itself.
Next, give the sixth products further vertical weight by the use of dragging it all the way through 2 rows.

Hover over the rule indicator and open its settings. Change Purpose Offset from that individual position to Every sixth Products. The identical Row Span now applies to items 6, 12, 18, and so on for the reason that Loop grows.
The outlet card remains probably the most robust anchor, while the repeating sixth-item rule introduces each different higher shape at predictable sessions.
If you wish to have the opening two-by-two anchor itself to replicate in six-item blocks, use a Custom designed nth-child Rule very similar to 6n+1, which objectives items 1, 7, 13, and so on.
2. The Alternating Wide Card Construction
Now not every Grid needs one dominant feature card. An alternative choice is to build rhythm by the use of alternating slender and huge taking part in playing cards throughout the feed.
This construction works smartly for info archives, helpful useful resource libraries, elegance pages, and other Loops where the content material subject material carries slightly identical importance then again the construction must nevertheless in point of fact really feel a lot of.
Keep the mummy or dad Grid at 3 columns. Drag the second products so it spans 2 columns.

Open the generated rule and change its Purpose Offset to Even Items.

Now items 2, 4, 6, and the other even positions span two columns, while the rest items keep the default single-column width. The end result’s a repeating narrow-and-wide rhythm made out of one Loop card and one focused container rule.
3. The Staggered Column Grid
The next construction supplies variation in two dimensions. Instead of changing most straightforward the width of determined on taking part in playing cards, we’ll let routine items occupy additional rows and columns.
This treatment works in particular smartly for image-forward blogs, portfolios, and visual archives where higher taking part in playing cards can interrupt the average Grid without requiring a separate featured-content segment.
Set the Grid to 4 columns. Drag the third Loop products until it spans 2 columns and 2 rows.

Open the following rule and change the Purpose Offset to Every third Products. The larger two-by-two treatment now repeats at positions 3, 6, 9, 12, and so on.

The average one-cell taking part in playing cards and repeating higher taking part in playing cards create a stepped visual rhythm for the reason that Loop continues.
If the larger spans pass away unused cells that you wish to have later items to fill, assessment Grid Density throughout the parent Construction settings. Dense we could in later items to backfill gaps, while Auto preserves same old placement order. Use Dense when the visual construction benefits from tighter packing and the following visual order nevertheless is sensible for the content material subject material.
4. The Asymmetric Duo
The Asymmetric Duo uses routine vertical spans to break up the standard Grid and create pairs with different visual weight. Instead of introducing one oversized hero and returning immediately to uniform taking part in playing cards, higher positions reappear throughout the feed.
Get began with a 3-column Grid. Drag the principle products so it spans 2 rows. Move away this as a focused first-item treatment so the opening card creates the initial destroy throughout the construction.

Next, drag the fourth products to span 2 rows as smartly. Open that rule and change its Purpose Offset to Every Fourth Products.

The principle card receives its private vertical emphasis, while items 4, 8, 12, and later matching positions repeat each different tall treatment all the way through the Loop. The standard taking part in playing cards continue flowing spherical those higher anchors consistent with the Grid’s placement laws.
This kind of construction works smartly for case analysis, tutorials, portfolio entries, or image-heavy feeds where routine visual emphasis keeps a longer archive from becoming too uniform.
Make Fancy Loop Grids Responsive
The desktop Grid will also be as elaborate for the reason that design calls for, then again the identical Offset Regulations inherit into smaller breakpoints till you override them. That makes Tablet and Phone a very powerful final step every time taking part in playing cards span a couple of rows or columns.
Switch to the Tablet breakpoint and assessment the mummy or dad Grid. A four-column desktop construction would possibly become two columns, while a three-column construction may also art work upper as two. Then check up on each Grid Offset Rule and change any Column Span, Row Span, Column Get began, or Row Get began values that not make sense with the smaller building.
On Phone, a single-column Grid is regularly the cleanest variety for content-heavy taking part in playing cards. A desktop rule that tells an products to span two columns has no useful task in a one-column construction, so override or neutralize that worth at the Phone breakpoint while retaining the desktop construction intact.
Moreover take a look at the image treatment after the taking part in playing cards industry width. Aspect Ratio, Framing, spacing, typography, and button placement can all download responsive values if the wider mobile taking part in playing cards need a different treatment.
The aim isn’t to force the desktop construction onto every show. Keep the hierarchy and rhythm where they help, then simplify the development where readability problems further.
Assemble Additional Inventive Loop Layouts With Divi 5
The Loop Builder, CSS Grid, and Grid Editor in Divi 5 each deal with a singular layer of the overall construction.
The Loop Builder determines what content material subject material repeats. CSS Grid gives those repeated items a container-based building. The Grid Editor gives you a visual way to shape that building and turn specific particular person placements into repeating Grid Offset Regulations.
That implies the inventive part of the construction doesn’t need to disappear merely because the content material subject material is dynamic. Assemble one card, connect it to the Loop, define the Grid on its parent, and then come to a decision where the advance must destroy: the principle products, every even products, every third products, every sixth products, or a practice nth-child collection.
The content material subject material can keep changing while the design device stays in control.
The post Construct Fancy Loops With Divi 5’s New CSS Grid Editor gave the impression first on Sublime Subject matters Weblog.


0 Comments