Skip to content

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.

Next: JavaScript hooks and events.