gillish

Add a table of contents

The Table of Contents block A piece of a page, such as a paragraph, a picture or a button. In WordPress you build a page by putting blocks one after another. lists the headings on the page, each one a link, and keeps the list up to date for you. The list below is this block, with its colours changed. See more of it on the Table of Contents page.

Add a table of contents

  1. Add the Table of Contents block near the top of the page.

  2. Type over the title if you want other words.

  3. In the Settings tab, choose which heading levels it lists.

A Table of Contents on a white card, with numbered headings and sub-headings, in the editor, and the Table of contents panel in the Settings tab with Show title and the heading levels.
A list of a page’s headings, with its settings.

With no headings on the page yet, the editor shows an example list and says so.

The Table of Contents settings

All of these are in the Settings tab. Show title is on to start. Type over the title on the block to change its words.

Heading levels

Minimum heading level is 2 to start and Maximum heading level is 3, so the list holds the H2 and H3 headings. Each level steps in under the one above it. Set the maximum to 2 for the main parts only, or up to 6 to list every level. Set the minimum to 3 to leave the H2 headings out.

Two lists of the same headings. On the left, four main parts only. On the right, three levels, down to H4.
The same page: the maximum set to 2, and set to 4.

List style

List style has five choices:

  • None is a plain list, and the choice to start with.
  • Numbers (1.1.1) show the full path, such as 1, 1.1 and 1.1.1.
  • Legal (1.a.i) mixes a number, a letter and a Roman numeral.
  • Roman (I.I.I) uses Roman numerals all the way down.
  • Bullets mark each level with a dot, then a ring, then a square.
Four lists of the same headings on white cards, marked with Numbers, Legal, Roman numerals and Bullets.
Numbers, Legal, Roman and Bullets.

Hide a heading or give it a shorter name

Under Headings, each heading has its own row. Click the eye to hide that heading from the list. Type in its box to give it a shorter name in the list. An empty box keeps the heading’s own words. The heading on the page stays as it is. Two headings with the same words share one row’s setting.

Two lists. On the left, every heading. On the right, four sub-headings are gone, Previous owners reads Owners, and Take a test drive reads Test drive.
Every heading, and the same list with four hidden and two shortened.

Let readers fold the list away

Collapsible list adds an arrow beside the title, and a click folds the list away. It starts open, and it works at any screen size.

Two lists with an arrow beside the title. The left one is open. The right one is folded, so only its title shows.
The same setting, open and folded.

Float the list beside the text

Float beside the content pins the list to the side of the screen as the reader scrolls. On small screens, it stays in the text. These choices then appear:

  • Side: Right to start, or Left.
  • Width: 280 pixels to start.
  • Max height (0 fits the content): set a height, and a longer list scrolls inside the panel.
  • Let readers dock it away is on to start. It adds a close button, and a click puts the list back in the page.
  • When a reader docks it: Keep it docked across visits remembers the choice on that device. Only for this visit lets the list float again next time.

Highlight the section in view marks the link for the part being read as the reader scrolls. This shows on the live page, not in the editor. Back-to-top link (off to start) adds a link at the end of the floating list that jumps to the top of the page. It shows only while the list floats, on the live page, and Back-to-top text changes its words.

A page of text with a white list floating at the top right, a close button in its corner, the link Check the history marked as the part being read, and a Back to top link at the end.
The list floating beside the text, with the part being read marked.

A bar fixed at the top of the screen

If your theme The design of your whole site: its fonts, colours and where the menu and footer go. You pick it under Appearance, then Themes. keeps a bar fixed at the top of the screen, set its height under Height of a fixed top bar (px), so a heading you jump to is not hidden behind it. It is 0 to start.

Colours and shape

Where you set the look depends on where you edit the block. In a normal post or page, the Styles tab has WordPress’s own controls: colour, typography, padding and margin, and border. In a saved Cairnstone block, under Cairnstone → Blocks, the Styles tab has Cairnstone’s full set: colour (a ready-made set or your own), typography, border, shadow, filters, and size and spacing, each for the normal state and for hover, focus, pressed and switched off.

The same Table of Contents with bullets, and the Styles tab of a saved Cairnstone block with Color open.
The list’s colours, in the Styles tab.

What visitors get

A navigation area named Table of contents, with a link to every heading it lists.

Next, read Sort content into tabs.

Trails

Cairnstone