Just like Mediawiki websites you can also create a table of content box for some long blog posts of your WordPress site. Table of Content simply makes in-post navigation much easier and your users can easily jump to different sections of your posts they want to read. Secondly, it is also good for SEO, likewise Google and other search engines automatically shows direct links (in search results) which jumps to post sections. This article is on a free awesome WordPress plugin that enables you to create Table of Contents without any HTML or CSS coding.
To start, first install and activate Table of Contents Plus plugin then visit your admin area Dashboard -> Settings -> TOC+ page. From ‘Main Options’ tab, select where and when you like displaying the table of contents (default position is ‘before the first heading’). Also you can change it to top, bottom, or after first heading. Second important option is to set when you like the table of content to show up. By default, it displays table of contents if a post or page has over 4 heading tags but you can change this to some higher or lower value. There more options and features like it comes with a few skins you can choose from the Presentation option. Or you can create your own custom style skin easily.
Finally. save the changes. Now the plugin will automatically generate table of contents for your posts and post types.
But if in-case if you don’t want ToC for some specific posts then can display it on that post by adding
How To Disable Auto Insertion And Use Manual Insertion? You can disable auto-insertion from its admin settings page and then use
[toc] shortcode for manually inserting it inside your posts etc.
For displaying using a sidebar widget visit Dashboard -> Appearance -> Widgets page and drag-drop TOC+ widget to a widget area. You can tick the box next to ‘Show the table of contents only in the sidebar’ in order to display table of contents only inside widget in widget area and not inside your posts and post types.