Vendix Theme opens its places to plugins and child themes. This reference lists the documented hooks. The theme's readme FAQ and the notes in its code describe each one in more detail.
Print a layout in a theme location
The vendix_theme/location filter gets the location names of the Elementor Theme Builder: header, footer, single and archive. A plugin that prints its own layout for the location returns true; the theme then draws nothing of its own there.
add_filter( 'vendix_theme/location', function ( $printed, $location ) {
if ( 'header' !== $location ) {
return $printed;
}
// Print your header here.
echo '<header class="my-header">…</header>';
return true;
}, 10, 2 );
headerandfooterrun on every page.singleruns for a post, a page (the cart, checkout and account pages too), an attachment or another post type entry, a product and the 404 page.archiveruns for the posts page, post archives, search results, the shop and product categories and tags.- A location name does not say which kind of page is shown. Choose your template from the request (the post type,
is_404(),is_cart()and the like) and returnfalsefor the others. - When
singleorarchiveis printed, the theme prints only its header and footer around it. current_theme_supports( 'vendix-templates' )tells that the theme works this way.
A plugin layout comes first, then the Elementor Theme Builder, then the theme's own part.
Actions
| Action | Where it runs |
|---|---|
vendix_theme/header_before | Before the theme header, outside it |
vendix_theme/header_after_branding | In the header row, right after the logo or site title |
vendix_theme/header_actions | At the end of the header row; parts stand together in the .vt-header-actions group |
vendix_theme/header_after | After the theme header, outside it |
vendix_theme/footer_before | After the content and before the footer, whoever draws the footer |
vendix_theme/single_before_content | Just above the text of a post, with the post ID |
vendix_theme/single_after_content | Just below the text of a post, with the post ID |
vendix_theme/post_meta | End of the meta line of a post, with the post ID |
vendix_theme/card_meta | End of the meta line of a post card, with the post ID |
vendix_theme/news_* | The news places on News / Magazine sites: news_top_bar, news_ticker, news_post_meta, news_card_meta, news_before_content, news_after_content |
The header actions run only when the theme draws its own header. A minimal header, for example on the plain checkout, shows no header row actions. A transparent header lies over the top of the page and covers a part printed before or after it; check vendix_theme_header_transparent() first and leave the part out, as the theme does with the news top bar.
The post actions run on every site type. On news sites the vendix_theme/news_* actions stay where they are; the general ones come after them, except vendix_theme/single_after_content, which comes before vendix_theme/news_after_content.
Filters
| Filter | What it changes |
|---|---|
vendix_theme/site_type | The site type: business, store or news |
vendix_theme/defaults | The default value of every theme option, with the site type |
vendix_theme/header_minimal | Whether the theme header shows only the logo or site title |
vendix_theme/footer_minimal | Whether the theme footer shows only the footer text |
vendix_theme/page_options_post_id | The post whose Page Layout options apply, for views a page stands for, such as the shop |
vendix_theme/palette | The design system colors of the block editor palette |
vendix_theme/setup_url | The address of a plugin's guided setup for the welcome page |
vendix_theme/setup_complete | Whether the plugin's guided setup is finished, which hides the setup notice |
Plugins can also read the site type with vendix_theme_site_type().
Give the theme your colors and fonts
- Colors: the
vendix_theme/palettefilter gets an empty array. Return the design system colors as key and hex color, with the keysprimary,secondary,accent,heading,text,muted,border,bg_lightandbg_dark. The theme takes every valid hex color for the block editor palette and keeps its own palette when none is given. The site itself reads the--vendix-color-*CSS variables. - Type: set CSS variables on the root element,
--vendix-type-{body|h1|h2|h3|h4|h5|h6|menu}-{family|size|size-tablet|size-mobile|weight|line-height|letter-spacing|transform}, each only when it has a value. The theme reads them for the body text, the headings, the theme menu and the text, title and headings of news posts, with its own values as the fallback. Tablet sizes apply up to 1024 pixels and phone sizes up to 767 pixels.
CSS hooks
| Hook | What it tells |
|---|---|
vt-sticky-header class on <html> | A sticky theme header is shown |
--vt-sticky-header-height variable on <html> | The height of the closed sticky header, for parts that stick below it |
vt-menu-open class on <html> | The phone menu is open |
vt-header-slot class | A region beside the logo: on desktop the menu moves to its own row, on tablets and phones the region takes a full row |
--vt-back-to-top-offset variable | Moves the back to top button up, for plugin parts fixed at the bottom of the screen |
vt-type-business, vt-type-store, vt-type-news classes on <body> | The site type |
The sticky header class and variable are missing when the header is not sticky, when a plugin or the Elementor Theme Builder draws the header and when the header is hidden.