How to Exclude Specific Headings from Table of Contents?

You might have a requirement in certain cases where you need to hide the heading from the table of contents. We have made it possible in our UABB’s Table of Contents widget to exclude the unnecessary headings from the table.

Let’s see a couple of cases to get a clearer idea on how you can achieve the same on your end –

Case 1: Hide Headings from the Single Post Page

A Single Post Page having related posts under the post content could list its Headings under the Table of Contents.

Solution: Now, to resolve this issue, UABB provides a simple way out, we have provided a CSS class which is – uabb-toc-hide-heading. There’s no need to be afraid there’s no custom code required.

We just require to add the above-provided custom CSS to the module which is displaying the posts. The provided class could be added under the Advanced tab of the module under HTML Element > Class

Case 2: Hide Headings from the Single Page

Single Page is a simple page, which contains multiple headings added using the Heading module or using text editor,

Solution: Previous solution with a CSS class, will work the same, only the difference is that the classes will need to be added to the heading tags.

Here’s how the CSS class will need to be added, to the heading of the text editor –

Also, in any other case, you will just need to use the same class as provided, to exclude the specific heading from the table of contents.

Not the solution you are looking for? Check other articles, or open a support ticket.