Getting started with the DIY Layout
The DIY Layout gives you control of the HTML around each field in a View. Every field can have a tag that wraps its value, and every field except Custom Content can also have your own HTML before and after it. Your theme’s CSS, or the View’s Custom CSS, then gives the View its look.
Note: The DIY Layout is included with GravityView Pro and the GravityKit All Access Pass.
On a GravityView + Extensions (Legacy) license, the DIY Layout is a separate plugin. About the “GravityView + Extensions (Legacy)” license shows how to install it.
Turning the DIY Layout on or off #
The DIY Layout is built into GravityView Pro, so there is nothing to install. To turn it off or back on:
- Go to Plugins and click Features in the GravityView Pro row.
- Click Turn off or Turn on in the DIY Layout row.
While the separate DIY Layout plugin is active, it runs instead of the built-in copy. Moving from separate extensions to GravityView Pro explains how to remove it.
Creating a View with the DIY Layout #
- Go to GravityKit, then New View.
- Type a name for the View, and choose your form in the Data Source box.
- Under Choose a View Type, click Select on the DIY card.

- On the Multiple Entries Layout tab, click Add Field under Entries Fields and choose a field. Repeat for each field you want to show.
- Click Publish.
A new View has Show only approved entries turned on in its View Settings tab. If the View shows no entries, Why View entries may not be showing up explains how to approve them.
DIY prints no field labels on the page. Each field’s Admin Label names the field in the View editor only.
Wrapping a field in your own HTML #
Click the gear icon on a field to open its settings. Under Display, these settings shape the field’s HTML:
- Before Output: HTML and merge tags printed before the field, outside the Container Tag.
- Container Tag: the HTML tag that wraps the field’s value, from DIV, BLOCKQUOTE, PRE, H1 to H4, and P, or None for no wrapper. An Address field also offers ADDRESS. The field’s Custom CSS Class, under Advanced, goes on this tag.
- After Output: HTML and merge tags printed after the field, outside the Container Tag.
Example: a card for each teacher
A pottery studio lists its teachers from a form with a Name field and a Specialty field. The Name field opens each card, and the Specialty field closes it, with these settings:
| Setting | Name | Specialty |
|---|---|---|
| Before Output | <article class="teacher-card"> | <p class="teacher-meta"><span>Specialty: </span> |
| Container Tag | H3 | None |
| After Output | Leave empty | </p></article> |
| Custom CSS Class | teacher-name | Leave empty |
- Open the Name field’s settings, enter its values from the table, and click Close.
- Do the same for the Specialty field.

- Click Update.
Each entry now prints this HTML:
<article class="teacher-card">
<h3 class="teacher-name gv-field-205-1">Maria Lindqvist</h3>
<p class="teacher-meta"><span>Specialty: </span>Wheel throwing</p>
</article>On the Edit Entry Layout tab, DIY adds only a Container Tag, and only to the Custom Content field.
What to watch for
- When a field is empty, its Before Output and After Output are left out too. If a card opens in one field and closes in another, an empty field leaves the card open, so put that HTML on fields that always have a value.
- Spaces at the start and end of Before Output and After Output are removed. To keep a space, put it inside a tag, as in
<span>Specialty: </span>. - On a page where the View is embedded, shortcodes in Before Output and After Output print as plain text. To place a shortcode, add a Custom Content field, which runs shortcodes and has its own Container Tag.
- Typing an opening tag such as
<div>into either box adds its closing tag for you, and typing</gives</>. Delete what the box added, or paste your HTML in, which keeps it as written. - A tag opened in one box and closed in another gets a red mark in both boxes. The View still saves and prints the HTML as written.
Styling the View with CSS #
On the Multiple Entries page, the DIY Layout wraps the entries in a section element with the class gv-entries. The section starts with a heading, “Results”, that has the class screen-reader-text, so it doesn’t show on the page. With the teacher cards above, the View prints this HTML:
<div class="gv-diy-container gv-diy-multiple-container gv-container
gv-container-963 gv-themed gv-theme-vantage">
<section class="gv-entries" role="region">
<h2 class="gv-entries-title screen-reader-text">Results</h2>
<div class="gv-diy-view">
<article class="teacher-card">…</article>
</div>
<div class="gv-diy-view">
<article class="teacher-card">…</article>
</div>
</section>
</div>Style your own classes, such as .teacher-card, or reach the entries with a descendant selector, such as .gv-diy-multiple-container .gv-diy-view. A child selector such as .gv-diy-multiple-container > .gv-diy-view matches nothing, because the section is between them.
The hidden heading is the section’s first child, so :first-child never matches an entry. To pick entries by position, use :first-of-type and :nth-of-type().
Showing the cards in columns
- In the View’s Settings box, click Styles. With the Vantage theme selected, choose the number of columns under Columns.

- Click Custom Code and add your CSS to the Custom CSS box. This CSS gives each teacher card a border and a light background:
.teacher-card {
padding: 1.5rem;
border: 1px solid #d5e0de;
border-radius: 12px;
background: #f6f9f8;
}
.teacher-name {
margin: 0 0 0.5rem;
}
.teacher-meta span {
font-weight: 600;
}
/* Hide the line the Vantage theme draws between entries. */
.gv-diy-multiple-container {
--gv-color-row-divider: transparent;
}- Click Update.

- On the Legacy theme, use the DIY CSS in How to display GravityView entries in a grid to show the entries in columns.
- To look up a class the DIY Layout prints, see the GravityView CSS guide.
- If the entries show in one column after an update, see Entries show in one column after updating GravityView.
Changing the DIY templates #
The HTML around the entries, such as the gv-diy-view wrapper of each entry, comes from these DIY template files in GravityView Pro:
- Multiple Entries page:
wp-content/plugins/gravityview/pro/features/diy/templates/views/diy.php - Single Entry page:
wp-content/plugins/gravityview/pro/features/diy/templates/entries/diy.php
To change one, override it in your theme. Copy it into a gravityview folder in your theme, inside the same subfolder, such as wp-content/themes/your-theme/gravityview/views/diy.php. GravityView then loads your copy instead.