How To Build A Header

The header is the one piece of design every visitor meets, and in Canvas you build it once, as a Header record, in the Header Builder. A header record holds everything about that header: its rows, the logo, menus and buttons in them, and its own settings for stickiness, transparency, colour scheme and menu style. You then make it the site default, give it display conditions, or hand it to the pages that need it. Changing it later is one edit.

How To Start A Header

Starting screenthe WordPress admin, CanvasHeader Builder. Headers, like every piece of site chrome, can be created and edited only by users who can edit the site's theme options, which in WordPress means Administrators.

  1. Choose Add New. The Choose a header design window opens on its own.
  2. Pick a starting point. Every card previews your own front page with that header, so you judge it with your logo and your menu. Use Search header designs to find one by name, and Show to narrow the list to Headers or Menus.
  3. Choose a card to load that design, or choose Start from the basic header for a single row with a logo and the menu.
  4. Give the header a name you will recognise later in the title field at the top of the canvas, then Publish.

Start from the design closest to what you want: adjusting a working header is faster than composing one from nothing. You can open the window again at any time from Start from a preset in the Header Builder panel of the sidebar. If the header already has changes, Canvas asks before replacing them, and Undo brings them back.

How A Header Is Put Together

A header has two areas, and each area holds rows:

  • The Scrolling Area holds rows that scroll away with the page, such as a contact strip above the main bar.
  • The Sticky Area holds the rows that stay at the top of the screen when the header is sticky.

Each row has three places for elements, Left, Center and Right, and the header has a fourth, Off-canvas, for the panel the mobile menu opens. Inside them go the elements from the Canvas Header block category: the logo, navigation, search, cart, buttons, icon links, contact details, social icons and the rest. A Canvas Header Zone groups elements inside a place, so they move and align together.

Canvas writes the sticky wrapper and its placeholder for you, so the header always keeps the structure the theme's scripts expect.

How To Add Rows And Elements

  1. To add a row, select an area and choose the + button inside it. The new row arrives with its Left, Center and Right places.
  2. To add an element, select a place or a zone and choose its + button, then search for the element by name. Only header elements are offered in a header, so the list stays short.
  3. Drag elements between places and rows in the canvas, or in List View in the editor's top bar.
  4. To remove an element or a row, select it and choose Options, the three dots in the block toolbar, then Delete. The areas and the places inside a row cannot be removed, because the header needs them.

Select a row to set its layout in the Layout panel: Direction, alignment, Row Container (Boxed or Full Width), Row Container Classes and Row Container Corner Radius for a rounded floating bar. Settings named Above The Menu Breakpoint apply once the full menu shows, so a row can stack on phones and sit side by side on a laptop.

How To Set How The Header Behaves

Choose Edit header settings in the Header Builder panel to select the header itself. Its settings are grouped in panels:

  • Layout: Header Layout (full, floating, side and the rest), Header Style, Size, Container Width, and the floating bar's background and offset.
  • Transparency & Scheme: Transparent, to draw the header over the first section, and its Colour Scheme.
  • Sticky: Sticky Header, how the bar shrinks while pinned, its offset, and the pinned menu colour and shadow.
  • Mobile: Menu Breakpoint, the width below which the menu collapses, and Sticky On Mobile.
  • Top Bar: the top bar shown above this header and its colour scheme.
  • Menu Style: menu item style, spacing, font size, dropdown arrow, item sub-titles, the Dropdown Skin and whether dropdowns open on hover or click.
  • Colours: the header background, the pinned background, and the menu and dropdown link colours.

Each setting starts at Theme Options, which means it follows Canvas > Theme Options > Header. Choose a value and this header keeps it. A page that sets its own value in its Header Settings panel still wins on that page, so one header can be solid on most pages and transparent on the front page. The Header options reference lists every Theme Options default, and Header Options Per Page covers the page level.

How To Preview Devices And States

The Header Builder panel in the sidebar changes what the canvas shows, never the header itself:

  • Device: Desktop, Tablet or Mobile. The canvas narrows to that width and the header rearranges as it will on that device. Leave Hide blocks hidden on this device on to see only what that device shows.
  • Header State: Default, Sticky, Transparent, Dark or Menu open. The canvas holds the header in that state, so you can set the sticky colours or the open mobile menu while you see them.

The panel also tells you the width below which the menu collapses into the mobile menu, and where that width is set.

How To Choose Where It Shows

A published header shows nowhere until something picks it. In order of strength:

  1. A page's own choice. On a page's edit screen, the Header Settings panel has a Built Header select. A page that picks a header always gets it.
  2. Display conditions. The header's Display Conditions panel shows it on the views you choose: the front page, the blog, search results, the 404 page, the shop, posts, archives, categories, or specific pages, for everyone or for logged-in or logged-out visitors, between two dates. When several headers match, the highest Priority wins.
  3. The site default. In Canvas > Header Builder, hover over a header and choose Set as Default. It shows everywhere nothing else picks a header.

The Display Conditions column of the header list summarises where each header shows, and the Preview column and row action show it on your front page.

How To Copy A Header

Hover over a header in Canvas > Header Builder and choose Duplicate. The copy is a draft named "(Copy)", without the original's display conditions, so it cannot take over any page until you publish it and say where it shows.

Where The Logo Comes From

The Canvas Header Logo element shows your site logo unless you give it a Logo Override of its own. Set the logo once, as Site Logo in the General tab of Canvas > Theme Options, and every header that leaves the override empty picks it up.

That Site Logo is WordPress's own site logo, so it is one image with several doors: changing it in Theme Options, in the Site Editor's Site Logo block, or in the Customizer's Site Identity panel where your site offers the Customizer changes it everywhere at once. The dark, mobile and retina versions remain Canvas settings on the same General tab: the dark and mobile logos fall back to the main logo while they are empty, and the retina versions are used only while Enable Retina Logo is on.

The small icon in the browser tab is WordPress's Site Icon, set under Settings > General, or in the Site Editor with the Site Logo block's Use as Site Icon setting.

Pitfalls

  • You published a header and the site did not change. Publishing creates the header; something must pick it. Choose Set as Default, add display conditions, or pick it in a page's Built Header select.
  • A page ignores your display conditions. A page that picks a header in its own Built Header select always keeps it. Set that select back to Inherit (use global default) to let conditions and the default decide.
  • A setting on the header has no effect on one page. That page sets the same thing in its Header Settings panel, and the page wins. Set the page's value back to its default.
  • The navigation reads "Assign a menu in the block settings". That row is a prompt drawn only in the editor. Pick a menu in the navigation's settings, or assign one to the Primary Menu location, before you judge the header on the site.
  • Your second navigation or second row misbehaves on mobile. With more than one navigation in a header, tell each row's mobile trigger which navigation it opens; a trigger with no target opens them all. The Canvas Header Container reference covers the trigger settings.
  • An Editor or Author cannot open or create headers. Headers and the rest of the site chrome are reserved for users with the edit_theme_options capability, which WordPress gives to Administrators. Ask an Administrator to make the change.

Continue with How To Edit Menus In The Header Builder to change the menu without leaving the header, How To Build A Mega Menu for the dropdown panels, and Top Bars for the strip above the header.

Was this page helpful?