> ## Documentation Index
> Fetch the complete documentation index at: https://vr-it-services-pro.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Template files

> Every template file, what it renders, and how to override it.

Vara SaaS is a **classic PHP theme**. WordPress picks the right template using its standard hierarchy, and each template is a plain PHP file you can copy into a child theme and edit.

> [!WARNING]
>
> **Never edit these files in the parent theme.** Every change is lost on the next update. Copy to a child theme at the same relative path instead — see [Child themes](/developers/child-themes.md).

## The hierarchy

WordPress selects a template for each request in this order. The first match wins.

| Request | Template |
| - | - |
| A page assigned a specific template | That template file |
| Static front page | `front-page.php` |
| Posts page | `home.php` |
| Single post | `single.php` |
| Single page | `page.php` |
| Archive (category, tag, author, date) | `archive.php` |
| Search results | `search.php` |
| Not found | `404.php` |
| Anything else | `index.php` |

![Screenshot: a diagram of the WordPress template hierarchy as used by Vara SaaS](https://mintlify.s3.us-west-1.amazonaws.com/vr-it-services-pro/images/screenshots/template-files-hierarchy.png)

## Core templates

| File | Renders | Overridable |
| - | - | - |
| `functions.php` | No output — setup, assets, features | Merged with the parent, not replaced |
| `header.php` | Document head, `<body>`, site header, opens `<main>` | Yes |
| `footer.php` | Closes `<main>`, site footer, `wp_footer()` | Yes |
| `front-page.php` | Your homepage | Yes |
| `home.php` | Blog index | Yes |
| `single.php` | A single post | Yes |
| `page.php` | A static page | Yes |
| `archive.php` | Archive listings | Yes |
| `search.php` | Search results | Yes |
| `404.php` | Not found | Yes |
| `index.php` | Last-resort fallback | Yes |
| `comments.php` | Comment list and form | Yes |
| `searchform.php` | Styled search form | Yes |
| `sidebar.php` | Sidebar wrapper and widgets | Yes |
| `template-page-builder.php` | Bare full-width canvas | Yes |
| `style.css` | Theme header and light-mode design tokens | Yes |
| `theme.json` | Block editor palette, fonts, sizes | Merged, not replaced |
| `rtl.css` | Right-to-left overrides | Yes |

## What each template does in detail

### `header.php`

Loads `template-parts/head.php`, outputs `<body>`, runs `wp_body_open()`, renders the skip link, opens the `#vara-saas-site` wrapper, prints the site header markup, and opens `<main id="site-content">`.

> [!WARNING]
>
> **The skip link target is `#site-content`.** If you override this template and change that id, update the skip link too, or keyboard users lose their main-content shortcut.

### `footer.php`

Closes `</main>`, opens `<footer>`, renders `template-parts/footer-widgets.php`, closes the site wrapper, and runs `wp_footer()`.

> [!WARNING]
>
> **Overrides must keep tags balanced.** `header.php` opens `<main>` and `footer.php` closes it. A mismatch produces two main landmarks, or unbalanced HTML — see [Missing header or footer](/troubleshooting/missing-header-footer.md).

### `front-page.php`

The most conditional template. It resolves at runtime:

1. If **Settings → Reading** shows your latest posts → renders the blog index inline
2. If a static front page is set and it is builder-owned with content → renders content alone
3. Otherwise → renders the six default sections

> [!NOTE]
>
> `front-page.php` calls `template-parts/head.php` and `template-parts/header-nav.php` directly rather than `get_header()`. If you override it, preserve that structure.

### `single.php`

The most feature-dense template. Renders category pills, title, excerpt, byline, featured image, table of contents, content, tags, related posts, and comments. See [Single post settings](/customization/single-post-settings.md).

### `page.php`

Renders breadcrumbs, an optional title, content, comments, and an optional sidebar. Steps aside entirely on builder-owned pages.

### `index.php`

The last-resort fallback: a container, an optional sidebar, and a plain post list.

> [!WARNING]
>
> `index.php` uses an `h1` for every post title, which is inconsistent with every other template in the theme — those correctly use one `h1` in the hero plus `h2` and `h3` in cards. It rarely renders, but if you build a child theme, correcting it is a worthwhile accessibility fix.

## `template-parts/`

Reusable components. Copy any of these into your child theme at the same path to override.

### Structure

| File | Purpose |
| - | - |
| `head.php` | Doctype, `<head>`, font preloads, the anti-flash inline script |
| `header-nav.php` | The standalone site header |
| `footer-widgets.php` | Footer grid with brand, columns, socials, and copyright |

> [!WARNING]
>
> **`header.php` contains its own copy of the header markup rather than including `header-nav.php`.** The two are near-identical but separate files, so a change to one does not affect the other. If you override either, check whether the other also needs updating.

### Blog

| File | Purpose |
| - | - |
| `blog-hero.php` | Blog hero: title, subtitle, search form, category pills |
| `content-blog-card.php` | Standard post card |
| `content-blog-featured.php` | Large featured card |
| `content-aside.php` | Compact card for the aside post format |

### Default front-page sections

| File | Section |
| - | - |
| `section-hero.php` | Hero with eyebrow, headline, two CTAs, stat card |
| `section-features.php` | Four feature cards |
| `section-testimonials.php` | Testimonial cards |
| `section-pricing.php` | Pricing tiers |
| `section-cta.php` | Closing call to action |
| `section-blog-preview.php` | Three most recent posts |

> [!WARNING]
>
> **`footer-widgets.php` declares a helper function inside the template.** PHP will redeclare it on every footer render path. It works, but if you override this file, keep that function guarded or move it to `functions.php` in your child theme.

## `inc/`

| File | Purpose |
| - | - |
| `customizer.php` | All Customizer settings, controls, and sanitizers |
| `elementor-setup.php` | Elementor global color and typography injection, layout builder |
| `plugins.php` | Setup wizard, plugin detection, managed pages and menus, AJAX handlers |
| `demo-import.php` | Applies the bundled Elementor JSON to pages |

> [!WARNING]
>
> **Do not copy `inc/` files into a child theme to "update" them.** They are loaded by the parent theme's `functions.php`. Use the filters on the next page instead.

## How to override a template

**1. Create a child theme**

If you have not already. See [Child themes](/developers/child-themes.md).

**2. Copy the file to the same relative path**

For example `single.php` goes in `wp-content/themes/your-child-theme/single.php`.

**3. Edit your copy**

Make one change at a time.

**4. Test**

View that page type, plus your header and footer.

> [!WARNING]
>
> **Template overrides are complete replacements, not merges.** If your copy omits `get_footer()`, the footer disappears. If you omit the loop, no content renders. Diff your copy against the original after editing.

## Prefer filters where available

Most of what you would override a template for is already filterable.

| Instead of overriding | Use |
| - | - |
| Editing the reading time | `vara_saas_estimated_reading_time` |
| Changing the byline | `vara_saas_show_page_title` and related filters |
| Restyling via CSS | `Appearance → Customize → Additional CSS` |
| Changing body classes | `vara_saas_body_classes` |

See [Hooks and filters](/developers/hooks-and-filters.md).

> [!WARNING]
>
> **Do not open a second `<main>`.** `get_header()` already opened `<main id="site-content">`.

## Related

> **[Child themes](/developers/child-themes.md)**
>
> The mechanics of overriding.

> **[Hooks and filters](/developers/hooks-and-filters.md)**
>
> Prefer these where they exist.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.