Skip to content

humanmade/hm-table-of-contents-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

// Don't append an anchor link to each heading.
add_filter( 'hm_toc.contents.anchor_html', '__return_empty_string' );