Overriding GravityView templates
GravityView builds each View from PHP template files. To change the HTML of a View, a Single Entry page, or a field, copy its template file into your theme and edit the copy. GravityView then loads your copy in place of its own, and GravityView updates leave your copy alone.
Note: If your theme gets updates from its author, put the copies in a child theme. A theme update deletes the theme’s folder, files you added included.
Where the template files are #
| What the file shows | Built-in file, in wp-content/plugins/gravityview/ | Your copy, in wp-content/themes/your-theme/ |
|---|---|---|
| The Multiple Entries page of a Table, List, or Layout Builder View | templates/views/ | gravityview/views/ |
| The Single Entry page | templates/entries/ | gravityview/entries/ |
| A field’s value | templates/fields/ | gravityview/fields/ |
| The DIY Layout | pro/features/diy/templates/views/diy.php (Multiple Entries) and pro/features/diy/templates/entries/diy.php (Single Entry) | gravityview/views/diy.php and gravityview/entries/diy.php |
Keep the folders that come after templates/ and leave out the templates folder itself. GravityView doesn’t look for copies inside a templates folder in your theme.
The DIY Layout is built into GravityView Pro. To turn it on or off, go to Plugins and click Features in the GravityView Pro row. On a GravityView + Extensions (Legacy) license, the DIY Layout is a separate plugin, and its template files are in wp-content/plugins/gravityview-diy/templates/.
Overriding a View template #
The List layout prints its header with list-header.php. To change it:
- In your theme’s folder, create the folders
gravityview/views/list/. - Copy
list-header.phpfrom GravityView’stemplates/views/list/folder into it. - Edit the copy.
- Built-in file:
wp-content/plugins/gravityview/templates/views/list/list-header.php - Your copy:
wp-content/themes/your-theme/gravityview/views/list/list-header.php
Every List View on the site then uses your copy.
Overriding a field template #
Each field type has its own template, named after the type, such as field-email-html.php for Email fields. To change how List fields show their rows:
- In your theme’s folder, create the folder
gravityview/fields/. - Copy
field-list-html.phpfrom GravityView’stemplates/fields/folder into it. - Edit the copy.
- Built-in file:
wp-content/plugins/gravityview/templates/fields/field-list-html.php - Your copy:
wp-content/themes/your-theme/gravityview/fields/field-list-html.php
Overriding a template for one View #
To change a single View, start the copy’s file name with view- and the View’s ID. GravityView uses that file for that View and the general copy, or its own file, for the others. For a View with the ID 46:
gravityview/views/list/view-46-list-header.phpchanges the List header of that View.gravityview/fields/view-46-field-list-html.phpchanges its List fields.
The ID is the number in the View’s shortcode, shown in the Embed Shortcode box when you edit the View.

Overriding the page template #
At a View’s own address, such as example.com/view/member-directory/, WordPress shows the View in your theme’s template for single posts. Its Single Entry pages use the same template. To give Views a template of their own, such as one without a sidebar:
- In a classic theme, copy
page.phpin your theme’s folder and name the copysingle-gravityview.php. - In a block theme, copy
templates/page.htmlin your theme’s folder and name the copytemplates/single-gravityview.html.
A View embedded in a page with a shortcode or a block keeps that page’s template. WordPress’s template hierarchy explains how WordPress picks a template. If your template still doesn’t show, Custom single View template not displaying lists what to check.