=== LuckyWP Table of Contents === Contributors: theluckywp Donate link: https://theluckywp.com/product/table-of-contents/ Tags: table of contents, toc, navigation, links, seo Requires at least: 4.7 Tested up to: 6.7 Stable tag: 2.1.9 Requires PHP: 5.6.20 License: GPLv2 or later License URI: https://www.gnu.org/licenses/gpl-2.0.html Creates SEO-friendly table of contents for your posts/pages. Works automatically or manually (via shortcode, Gutenberg block or widget). == Description == Creates SEO-friendly table of contents for your posts, pages or custom post types. Great customizable appearance. #### Features * Automatical insertion a table of contents (configure post types and position). * SEO-friendly: table of contents code is ready to use by Google for snippets on result page. * Insert by shortcode, Gutenberg block or widget. * Button on toolbar of the classic editor. * Gutenberg block into "Common Blocks". * Setting the minimum number of headings to display table of contents. * Setting the depth of headings for table of contents. * Skip headings by level or text. * Hierarchical or linear view. * Numeration items: decimal or roman numbers in order or nested. * Customizable appearance: width, float, title font size and weight, items font size, colors. * Color schemes (dark, light, white, transparent, inherit from theme) and the ability to override colors. * Toggle Show/Hide (optionally) * Customizable labels. * Smooth scroll (optionally). * Setting offset top for smooth scroll. * Wrap table of contents with <!--noindex--> tag (optionally). * Pretty hash in URL (like `example.com/faq/#how_do_this`). * RTL support. * Available override global settings for a particular post. * Highly compatible with WordPress themes and plugins. #### Auto Insert For automatical insertion a table of contents in a posts, select option "Auto Insert Table of Contents" in the plugin settings (tab "Auto Insert"). Supported positions: * before first heading; * after first heading; * after first block (paragraph or heading); * top of post content; * bottom of post content. You can also select post types to which the table of contents will be automatically added. #### Manual Insert For manual insertion a table of content in a posts, use one of the ways: * button "Table of Contents" on toolbar in classic editor; * gutenberg block "Table of Contents"; * shortcode `[lwptoc]`. #### Pretty hash in URL By default, hash generated as heading text (for example, `#How_Do_This`). You can change hash format in global settings, tab "Misc.". For non-English websites it is recommended to enable the `Intl` PHP extension. ### Compatibility LuckyWP Table of Contents was successfully tested with the following plugins: * Elementor Page Builder * Beaver Builder and Beaver Builder Themer Add-On * WPBakery Page Builder * Oxygen * WordPress Multilingual Plugin (WPML), [officially confirmed](https://wpml.org/plugin/luckywp-table-of-contents/) * Rank Math, [officially confirmed](https://rankmath.com/compatibility/luckywp-table-of-contents/) * WP Rocket * Toolset Views and Toolset Access ### Hooks #### Filters `lwptoc_before`, `lwptoc_after` Use for add custom HTML before/after the table of contents. Example: add_filter('lwptoc_before', function ($before) { return '

Example text before TOC.

' . $before; }); #### Filter `lwptoc_shortcode_tag` Use this filter for change shortcode tag name `[lwptoc]`. Example: add_filter('lwptoc_shortcode_tag', function ($tag) { return 'toc'; }); #### Filter `lwptoc_heading_id` Use for modify heading ID. Example: add_filter('lwptoc_heading_id', function ($id, $label) { return $id; }, 10, 2); == Installation == #### Installing from the WordPress control panel 1. Go to the page "Plugins > Add New". 2. Input the name "LuckyWP Table of Contents" in the search field 3. Find the "LuckyWP Table of Contents" plugin in the search result and click on the "Install Now" button, the installation process of plugin will begin. 4. Click "Activate" when the installation is complete. #### Installing with the archive 1. Go to the page "Plugins > Add New" on the WordPress control panel 2. Click on the "Upload Plugin" button, the form to upload the archive will be opened. 3. Select the archive with the plugin and click "Install Now". 4. Click on the "Activate Plugin" button when the installation is complete. #### Manual installation 1. Upload the folder `luckywp-table-of-contents` to a directory with the plugin, usually it is `/wp-content/plugins/`. 2. Go to the page "Plugins > Add New" on the WordPress control panel 3. Find "LuckyWP Table of Contents" in the plugins list and click "Activate". ### After activation Into classic editor will appear button "Table of Contents" (available on edit post/page screen). Into Gutenberg editor will appear block "Table of Contents" (see "Common Blocks"). The menu item "Table of Contents" will appear in the menu "Settings" of the WordPress control panel. For non-English websites it is recommended to enable the `Intl` PHP extension. == Screenshots == 1. Table of Contents 2. Gutenberg Support 3. Classic Editor Support 4. Customize Window 5. Examples of Color Solutions 6. Widget Settings 7. General Settings 8. Appearance Settings 9. Auto Insert Settings 10. Processing Headings Settings 11. Miscellaneous Settings == Changelog == = 2.1.9 — 2024-11-08 = * Fix "LuckyWP Plugins" page. = 2.1.8 — 2024-10-28 = * Adapt to WordPress 6.7. = 2.1.7 — 2024-10-18 = * Fix non-critical vulnerability. = 2.1.6 — 2024-10-04 = * Fix vulnerabilities. = 2.1.5 — 2024-09-05 = * Minor refactoring. = 2.1.4 — 2020-08-03 = * Minor refactoring. = 2.1.3 — 2020-06-07 = + Added hook filter `lwptoc_allow`. = 2.1.2 — 2020-05-08 = + Added hook filter `lwptoc_title_tag`. = 2.1.1 — 2020-03-15 = * In heading ID duplicate hyphens are replaced with one. * Fixed: content of tags `