HM TOC
Add anchors to headings in post content and generate table of contents.
by Human Made Limited · github.com/humanmade/hm-table-of-contents-plugin
★ 4stars
4.3kcomposer installs
1forks
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/humanmade/hm-table-of-contents-plugin/archive/refs/heads/main.zipAlso on Packagist as humanmade/hm-toc:
composer require humanmade/hm-tocFrom the readme
HM Table of Contents
WordPress plugin with the following features:
Generate table of contents that lists all headings (Ordered hierachically) in post content.
Automatically add anchors links after all headings in post content.
Block to add these to pages and template.
Adds 'active' class to the current heading in the table of contents.
FAQ
I don't want to automatically add anchor links to headings.
You can remove the filter that adds these with the following snippet. Doing it like this means that the plugin will still ensures headings all have IDs.
Read the full README on GitHub →