WordPress Table of Contents Plugin (CMTOC) - How To - Automatically Expand and Collapse Chapters in TOC


How To Automatically Expand and Collapse Chapters in TOC

Note: the feature described in this guide was presented in version 1.6.0.

With the The WordPress Table of Contents plugin it is possible to automatically expand and collapse chapters in TOC while the user scrolls through the relevant chapter in the article. This feature can be applied to either Floating TOC or Sticky Widget.

Enabling the Feature

To enable the feature, navigate to Admin Dashboard → CM Table of Contents Pro → Settings → Table of Contents tab.

Navigation to the plugin settings - WordPress Table of Contents
Navigation to the plugin settings

Under the General Settings section, enable the option Auto expand/collapse sub-chapters, then save the settings.

Enabling auto expanding/collapsing sub-chapters - Table of Contents WordPress
Enabling auto expanding/collapsing sub-chapters

Front-end Examples

Auto expanding and collapsing work a bit differently for Sticky Widget and Floating TOC.

Sticky Widget - in this case it expands and collapses only current sub-chapters of currently viewed chapter or sub-chapter:

Front-end example - WordPress Table of Contents Block
Front-end example

Floating TOC - in this case it expands all sub-chapters of the main chapter:

Front-end example - Add Table of Contents WordPress
Front-end example

More information about the WordPress Table of Contents Plugin

Other WordPress products can be found at CreativeMinds WordPress Store

Let us know how we can Improve this Product Documentation Page

To open a Support Ticket visit our support center
Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.