WordPress Table of Contents Plugin (CMTOC) - Widget - Placing TOC In Widget Areas


Widgets

The WordPress Table of Contents plugin comes with two Table of Contents widgets which allow to place TOC in widget area instead of over post/page content.

To display Table of Contents in widget area, navigate to Admin Dashboard → Appearance → Widgets.

Navigation to the widgets settings - WordPress TOC Plugin
Navigation to the widgets settings

Using the search bar, you can find 2 TOC widgets:

TOC widgets - TOC Table of Contents WordPress Plugin
TOC widgets

Classic Widget

The CM Table of Contents - Show Table of Contents widget is static and has 2 settings:

Adding TOC widget to the sidebar - Add Table of Contents WordPress
Adding TOC widget to the sidebar
  • Title - This setting is optional. Enter here the widget title. Note: if you want to change the TOC title, you need to change it in the plugin settings.
  • Post ID - This setting is optional. If it's empty, then each page will show its own TOC. Alternatively, you can define the post ID, and each page which show the TOC of the page that you define.

Open post/page edit page and check Enable Table of Contents... to enable searching TOC items (in case if it's not enabled for all posts of the selected type) and Disable automatic displaying... to hide standard TOC on this page. Update post/page.

Metabox with TOC settings - Floating Table of Contents WordPress
Metabox with TOC settings

Front-end Example:

Front-end view of post with Table of Contents as widget - WordPress TOC Plugin
Front-end view of post with Table of Contents as widget

Sticky Widget

Note: this widget was introduced in version 1.6.0.

Unlike the previous widget, the CM Table Of Contents - Show Sticky Widget Table of Contents allows to show the widget while the user is scrolling through the content.

When adding this widget to any widget area, it does not have any settings:

Adding sticky widget to the widget area - TOC Table of Contents WordPress Plugin
Adding sticky widget to the widget area

However, you can configure it in the plugin settings. To do it, 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

Scroll down and find the section Sticky Widget settings. It has the following settings:

Sticky widget settings - Table of Contents WordPress
Sticky widget settings
  • Title for sticky widget - Change the TOC title in the sticky widget.
  • Sticky widget border color - Choose the border color for the sticky widget.
  • Border width for the sticky widget - Choose the width of the border.

Front-end Example:

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

Auto-Expand Feature

Another useful feature that you can use together with the Sticky Widget is Auto-Expand feature (note: this feature was introduced in version 1.6.0). By default, all chapter in TOC are collapsed, and while the user is scrolling through the relevant chapter, its subchapters are automatically expanded. And when the user passes these chapters, they're automatically collapsed.

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

To enable this feature, head to the Table of Contents tab in plugin settings. Find and enable the option Auto expand/collapse sub-chapters under the General Settings section.

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

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.