Archived topic
TOC in post template won't add the heading IDs in the post
7 replies · Started by Stefan on October 9, 2021
Hey there,
I've created a simple post template you see in the image.
(In case the image won't work: https://imgur.com/a/8pNYytX)
The Problem:
The TOC shows up correctly in the post, grabbing all the headings I want, but it won't add the heading IDs to the headings itself. So the jump links are not working.
I've tried several plugins (simple toc, easy toc) but same situation.
Maybe I need to implement this with a hook? Or any other solution?
Thanks,
Stefan
Hi there,
how has the Post Template being created ? Is this using FSE templates ?
Hey David,
I used the block element with the element type content template.
Not sure if this falls under FSE, but I hope it helps.
It seems like that plugin only works in specific places such as in the post content or a widget area.
What if you add it to a regular sidebar ?
Basically that makes sense, but same problem. Toc shows up, but Heading Ids not added. Only if I put it in the actual post, then it works.
I don't get it at the moment, maybe I am mistaking a setting. But never had that problem before.
Can you share a link to a page where the ToC has been added to the theme sidebar so i can take a look to see whats going on?
The website is not live yet. I will see if I can replicate it on a subdomain. It's added in the sidebar of the theme as a widget, just to confirm.
If you get a chance to publish it on subdomain then i am more than happy to look at it. Just reply here if you need us to :)