[PRO] Adding a Table of Contents to Single Blog Posts

Would you like to add a table of contents to your blog posts so readers can jump to any section? Botiga Pro includes a table of contents module that builds the list automatically from your headings.

In this guide, we’ll walk you through how to add a table of contents to single blog posts in Botiga.

Before you get started, make sure you’ve installed and activated the Botiga theme on your WordPress site. If you’re using features from Botiga Pro, ensure that both the Botiga theme and the Botiga Pro plugin are installed and active. The table of contents is a Botiga Pro feature, so this requires Botiga Pro.

The table of contents feature is bundled as a module, so to start using it, enable the module from Appearance ยป Theme Dashboard.

Enabling the table of contents module in the Botiga Theme Dashboard

Once the module is enabled, new post editor options appear when you create or edit a blog post. While editing a post, scroll down to the Botiga Post Options box.

The table of contents settings in the Botiga Post Options box

  1. Enable: Enable or disable the table of contents.
  2. Enable Sticky Effect: Keeps the table of contents fixed at the top of the window as the reader scrolls.
  3. Title: The title of the table of contents.
  4. Target Headings: The table of contents is built automatically from your target headings.
  5. Bullet Type: Three bullet styles for the list: none, arrows, and ordered numbers.
  6. Target Offset Top: Creates a gap in pixels between the top of the window and the clicked heading when scrolling ends.

Excluding a heading from the table of contents

To leave a heading out of the table of contents, add the class toc-ignore as an Additional Class on that heading block.

Adding the toc-ignore class to a heading block's Additional Class field

That’s it! You’ve successfully added a table of contents to single blog posts in Botiga.

Next, would you like to fine-tune the rest of your single post layout? Check out our guide on the single blog post options to learn more.