humanmade/hm-toc
WordPress plugin that adds anchors to headings in post content and generates table of contents from headings.
Maintainers
Package info
github.com/humanmade/hm-table-of-contents-plugin
Type:wordpress-plugin
pkg:composer/humanmade/hm-toc
1.1.7
2024-11-27 20:14 UTC
Requires
- composer/installers: ^1 || ^2
Requires (Dev)
Suggests
None
Provides
None
Conflicts
None
Replaces
None
GPL-2.0-or-later ce5d5351974f7471bcfe8a5d88f6c6df9202affb
- Human Made <hello.woop@humanmade.com>
README
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.
// Don't append an anchor link to each heading. add_filter( 'hm_toc.contents.anchor_html', '__return_empty_string' );
