Identical headings on same post, getting identical id’s?

[ad_1]

Hey 🙂

SimpleTOC automatically generates id’s for the headings, right?

It appears that might generate duplicate id’s 🤔

So if I have a structure like:

<h2>The cucumber shop</h2>
  <h3>Location</h3>

<h2>The mango shop</h2>
  <h3>Location</h3>

… then both h3’s would be assigned the id="location" potentially causing some issues.

And it appears to happen on all posts and pages, even where SimpleTOC isn’t being used.

A workaround could be manually to assign a unique ID to each h3, like id="location-cucumber" and id="location-mango" and that might be doable on pages and posts where I’m actually using the SimpleTOC block and testing navigation after edit. But if an ID is assigned to all headings on all posts, regardless of whether SimpleTOC is used or not … it’s a lot of work.

Am I doing it wrong? Are you able to reproduce?

All the best
Bjarne

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer