Custom Templates

Estimated reading time: 5 min

Some pages on a WooCommerce site have no editor: product pages, category archives, the shop, the blog listing, search results. WordPress builds them from your data, so there is nothing to open in Elementor and no page settings box to fill in.

Custom Templates is the tool for those pages. You describe which part of the site you are aiming at, and then either change its settings, or rebuild its content with Elementor. Elementor PRO users will recognise the idea from its Theme Builder.

A single template can do either job, or both:

  • Override settings for a group of pages. Every product in one category gets a fixed header, no page cover and a different background, without editing a single product.
  • Override the content with Elementor. The page is built from Elementor widgets instead of the layout WooCommerce and Rey would produce.

Finding the list

The templates live under Rey Theme → Custom Templates in your WordPress admin.

The WordPress admin sidebar with the Rey Theme menu expanded, highlighting "Custom Templates", next to the templates list showing two or three entries.

Note: No such menu item? Open Rey Theme → Modules and enable Custom Templates for Elementor. The whole feature is a module and can be switched off.

Creating a template and aiming it somewhere

Add a new Custom Template and start on its TYPE & LOCATION tab. First pick the Type, which is the broad area you are targeting:

  • Page for ordinary pages;
  • Single for single posts and other single entries;
  • Archive for listings such as categories, tags, the blog and search results;
  • Product page for single products;
  • Product Archive for the shop and product category or tag listings.

Leave it there and the template applies to everything of that type: picking Product page with no conditions targets every product in the shop. Add conditions to narrow it down.

Each condition is a row with an Include or Exclude operator, a location, and the specific items. For products you can aim at Categories, Tags, Attributes or individual Products. Rows stack, so “include the Jackets category, exclude two products in it” is two rows.

A custom template's Type and Location tab, with Product page selected and a condition targeting a product category
Targeting the product pages that belong to the Jackets category.

Job 1: overriding settings for a group of pages

Below the targeting, the template carries the same options a single page has in its own settings box: header type, page cover, colours, layout, and the rest. Whatever you set here applies to every page the template matches.

That is the point of the feature. Making all product pages use a fixed header used to mean opening every product one at a time; here it is one template with no conditions and one option changed.

The custom template's settings, with header, page cover and style options
The same global options a single page has, applied to a whole group.

Individual pages win over the template by default, which is usually what you want: a product with its own header setting keeps it. To force the template’s value everywhere, switch on Override individual settings on the ADVANCED tab.

Job 2: overriding the content with Elementor

Set the targeting, save, then press Edit with Elementor at the top. From that moment every page the template matches renders whatever this template contains, instead of its normal content.

Inside Elementor you get a canvas and, in the widgets panel, the pieces the page is made of. Rey ships a full set of these for products: title, price, gallery, variations, add to cart, short description, tabs and blocks, reviews, related products, upsells, SKU, categories, tags, sharing, product navigation. Drop them where you want them, style them, done.

The Elementor editor with Rey's product page widgets listed in the panel on the left
The product page widgets, in the Elementor editor.

Product archives work the same way, with their own widgets for the products loop, the archive title and the archive description.

The Elementor editor with the product archive widgets listed in the panel on the left
The product archive widgets.

Tip: You do not have to start from an empty canvas. Rey’s Template Library has ready-made product pages and product archives: import one, then change what you need.

Here is the whole process end to end, as a short screencast: building a product page template that applies to all products (video).

Choosing what the editor previews

A template has no product of its own, so while editing, Elementor fills it with the first product or category it finds. To work against a specific one, open the settings gear in the bottom left corner of the Elementor panel and set Select Product for Preview (or Select Product Archive for Preview), then hit Apply & Reload.

This only changes what you see while editing. It has no effect on the front end.

The Elementor page settings panel for a custom template, showing Template Type and the "Select Product for Preview" control with the Apply & Reload button.

The same panel holds Template Type: leave it on Default to keep the header and footer, or pick Full Width or Blank Canvas if the design needs the whole viewport.

Posts, pages and non-product archives

The Page, Single and Archive types work the same, and their content override works too. The difference is that Rey’s ready-made building blocks exist for products only, so a post or a generic archive is assembled from ordinary Elementor widgets, with Dynamic Tags pulling in the title, the content, the featured image and the rest.

When two templates target the same page

Only one template is ever applied to a page. When several match, the one with the highest Priority wins. It is a plain number on the ADVANCED tab, and the biggest one takes it.

The usual arrangement is a broad template with a low priority as the baseline, plus narrower ones with higher priorities for the categories that need something different.

Telling whether a page is using a template

Look at the Rey logo in the admin bar while viewing the page. A dot next to it means a custom template is active:

  • a white dot: the template is only overriding settings;
  • a red dot: it is also overriding the page’s content.
The Rey logo in the WordPress admin bar with a coloured dot next to it
The dot next to the Rey logo marks a page served by a custom template.

Tip: To see a page as it would look without its template, add ?no-template=1 to the URL. It works for administrators only, and changes nothing for anyone else. Handy for telling apart “the template is wrong” from “the page itself is wrong”.

Frequently asked questions

Does this slow the site down?

There is more code running than on a page Rey renders by itself, so yes, some. How much depends entirely on what you build: a product page assembled from a dozen widgets costs little, one carrying several carousels, a filtered grid and a few animations costs a lot more.

The practical advice is the same as for any Elementor page. Keep the layout close to what the design actually needs, and check the result rather than assuming: Optimising your website’s speed covers how.

Why are the product page widgets missing on my normal pages?

Because each of them needs to know which product it is rendering, and that only exists on a product page or in a product template. On an ordinary page there is no product to read from, so the widget would have nothing to print.

This snippet in your child theme’s functions.php makes them show up in the editor everywhere:

add_filter('reycore/module/rey_templates/always_show_elements', '__return_true');

They will still not render anything useful outside a product context, so this is for special cases rather than a fix.

How do I add a Global Section to every product category?

Build it once as a Generic Global Section, then create a Custom Template of type Product Archive with no conditions, so it covers every product listing. In the template’s settings open the Advanced tab, and under Global Sections add a row: pick your section and choose where it should sit on the page. Short screencast: adding a global section to all product categories (video).

This is the settings job, not the content one, so the template does not need to be built with Elementor at all. The same Advanced tab exists on a single page, post, product or category, if you only need the section in one place.

Why can a product page not simply be edited like a page?

WordPress only gives an editor to posts, and a product is a post whose editor holds the description alone. Everything else on that page (price, gallery, variations, stock) is product data that WooCommerce arranges into a layout.

Archives go further: a category or a tag is not a post at all, it is a group of them, so there is no content to edit in the first place. The shop page, the blog page and the search results behave the same way even though a page exists behind them.

Custom Templates gets around this by putting an Elementor page in front of those layouts, one that still inherits the product or the category being viewed. That is why the widgets know what to print without you telling them.

Was this article helpful?