We'll create fresh WordPress site with LuckyWP Table of Contents installed. You have 20 minutes to test the plugin after that site we'll be deleted.
Creates SEO-friendly table of contents for your posts, pages or custom post types. Great customizable appearance.
example.com/faq/#how_do_this
).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:
You can also select post types to which the table of contents will be automatically added.
For manual insertion a table of content in a posts, use one of the ways:
[lwptoc]
.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.
LuckyWP Table of Contents was successfully tested with the following plugins:
lwptoc_before
, lwptoc_after
Use for add custom HTML before/after the table of contents.
Example:
add_filter('lwptoc_before', function ($before) {
return '<p>Example text before TOC.</p>' . $before;
});
lwptoc_shortcode_tag
Use this filter for change shortcode tag name [lwptoc]
.
Example:
add_filter('lwptoc_shortcode_tag', function ($tag) {
return 'toc';
});
lwptoc_heading_id
Use for modify heading ID.
Example:
add_filter('lwptoc_heading_id', function ($id, $label) {
return $id;
}, 10, 2);