---
url: https://docs.artemsemkin.com/velum/wp/developers/overriding-templates.md
description: >-
  Change the markup Velum prints by copying a theme or plugin template into the
  child theme, which templates can be copied, and how to replace one of the
  theme's functions instead.
---

# Overriding templates

Velum prints its markup from template files, and a copy in the child theme wins over the original. Copy the file, keep its path, and edit the copy. Your copy stays when Velum updates, and it also stops receiving the fixes that update brings to the original, so copy only the files you change and compare them with the new originals after an update.

## The theme's templates

The theme's files, such as `header.php`, `footer.php`, `single.php` or anything in `template-parts/`, follow the usual WordPress rule: a file at the same path in `wp-content/themes/velum-child/` replaces the one in `wp-content/themes/velum/`.

## The plugins' templates

The bundled plugins print some shared pieces from templates too. WordPress looks for each of them in the child theme first, then in the parent theme, then in the plugin. Put your copy at the same path in the child theme:

```text
wp-content/themes/velum-child/
├── velum/
│   ├── Button/Button.php
│   ├── DotList/DotList.php
│   ├── HeaderAccount/Menu.php
│   ├── HeaderCart/Count.php
│   ├── ImagePreview/Frame.php
│   ├── Media/Media.php
│   ├── MediaCaption/MediaCaption.php
│   ├── Properties/Properties.php
│   ├── ScrollDown/ScrollDown.php
│   └── TextContent/TextContent.php
├── shared-ui/
│   ├── Icon/Icon-Blink.php
│   ├── PaginationDots/PaginationDots.php
│   ├── QuantityStepper/QuantityStepper.php
│   └── svg/                    the arrow, chevron, play and quote icons
├── live-search/
│   └── result.php              one search result
└── post-password/
    └── form.php                the password form of a protected post
```

The originals of `velum/` are in `wp-content/plugins/velum-elementor/templates/`. Those of the other three folders are in the plugin's `vendor/` folder, under `arts/shared-ui`, `arts/live-search` and `arts/post-password`, each in `src/php/templates/`. To change the button every widget prints, for example, copy `templates/Button/Button.php` to `wp-content/themes/velum-child/velum/Button/Button.php`.

A template gets its data in `$args`, an array whose keys are listed at the top of the original. Keep the class names starting with `js-` and the `data-arts-*` attributes in your copy: the scripts find the element by them. `HeaderCart/Count.php` also keeps its `header-cart__count` class, which the cart updates when a product is added.

Two templates of the shop can't be overridden this way: `WooCommerce/Variation.php` and `WooCommerce/Ordering.php`. Velum Elementor prints them in place of WooCommerce's own variation and sorting templates inside its product widgets, so a copy in the child theme's `woocommerce/` folder doesn't show there either.

## Replacing one of the theme's functions

Every function in the theme whose name starts with `velum_` is defined only if it doesn't exist yet. The child theme loads first, so a function with the same name in its `functions.php` replaces the theme's, and the theme's own hooks call yours:

```php
function velum_render_skip_link() {
	// Your version of the skip link.
}
```

Copy the original from the theme's `inc/` folder and change what you need. As with templates, the theme's fixes to that function no longer reach your site, so prefer a hook when one does the job: see [PHP hooks and filters](./php-hooks).

Next: [JavaScript hooks and events](./javascript-hooks-and-events).
