| 开发者 |
wkhayrattee
Wasseem Khayrattee |
|---|---|
| 更新时间 | 2026年4月16日 06:10 |
| PHP版本: | 8.0 及以上 |
| WordPress版本: | 6.9.4 |
| 版权: | GPL-3.0-only |
| 版权网址: | 版权信息 |
[plovertoc] in your content[plovertoc] to your post or page where you want the table of contents to appear.top_level and depth attributes in the shortcode. For example: [plovertoc top_level="2" depth="3"]schema attribute in the shortcode. For example: [plovertoc schema="false"][plovertoc top_level="2" depth="4"] would mean generating a TOC that includes only H2, H3, H4 and H5 headings.
[plovertoc top_level="1" depth="3"] would mean generating a TOC that includes only H1, H2, and H3 headings.
[plovertoc top_level="1" depth="2"] would mean generating a TOC that includes only H1, and H2 headings.
Styling
You can target the css class "plover-toc-wrapper" and "plover-toc-items". See below the actual HTML structure to guide you.
```html
Open Table of contents
```
Localization
PloverToc supports localization. To translate the plugin into your language, add the appropriate translation files in the languages directory. The text domain for this plugin is plover-toc.
You can also customize the summary text of the table of contents by using the plover_toc_summary_text filter as shown below. The default summary text is localizable.
Changing the header (summary) text of the TOC
To customize the summary text of the table of contents, use the plover_toc_summary_text filter.
Example to change summary text:
php
function custom_toc_summary_text(string $text)
{
return __('My Custom Table of Contents', 'plover-toc');
}
add_filter('plover_toc_summary_text', 'custom_toc_summary_text');