| 开发者 | someguy9 |
|---|---|
| 更新时间 | 2026年10月27日 19:18 |
| 捐献地址: | 去捐款 |
| PHP版本: | 7.4 及以上 |
| WordPress版本: | 7.1 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
[headlight-toc] shortcode.<details> element. Choose to start open, start closed, or have no toggle.<nav> landmark named by its title, real links, and a native toggle that works with a keyboard and screen readers.[toc], [ez-toc], [lwptoc] and [no_toc] left in your posts by other table of contents plugins keep working once that plugin is deactivated.[headlight-toc] shortcode to a post.Every heading in the post itself as it is shown: Heading blocks, Classic Editor headings, and headings that come from patterns, shortcodes, Custom HTML, page builders like Elementor, and other blocks like GenerateBlocks and Kadence Blocks. Choose the levels (H1 to H6) in the settings or on the block. Headings in your theme's header, sidebar or footer aren't included.
Use the Table of Contents box on the post's edit screen and choose Hide, or add [headlight-toc-off] anywhere in the post ([no_toc] left by other plugins works too). Choose Show to add it to a post whose type isn't turned on in the settings.
Add the CSS class headlight-toc-exclude to the heading (Block > Advanced > Additional CSS class), or list its text under Settings > Table of Contents > Leave out headings. * works as a wildcard.
Enter the header's height under Settings > Table of Contents > Sticky header height. The WordPress admin bar is accounted for automatically. Some themes, like Kadence, scroll to links with their own script and handle their own sticky header.
Deactivate the old plugin (you'll see a reminder while both are active), then under Settings > Table of Contents > Heading links choose "Same as Easy Table of Contents" or "Same as Table of Contents Plus". The old plugin's leftover settings are used, so every heading gets exactly the id it had before and links people have shared to sections of your posts (like #What_is_SEO) keep working. This was checked against Easy Table of Contents 2.0.88 and Table of Contents Plus 202609.1 with headings full of punctuation, quotes, accents, emoji and non-Latin text.
[toc], [ez-toc], [lwptoc] and [no_toc] in your posts keep working too, and in the block editor "Convert to blocks" turns them into the Table of Contents block.
[headlight-toc title="In this post" levels="2,3" collapse="closed" list="bullets"] places it, and [headlight-toc-off] turns the automatic one off for that post.
title: the heading of the box.levels: which heading levels to list, e.g. 2,3.collapse: open, closed or off (no toggle).list: numbered, bullets or plain.Each page of a post split with a Page Break lists the headings on that page.
Not yet. The block and shortcode work inside post content.
No. Heading ids are added when the page is shown. In the block editor (with the standard link style), the plugin turns on WordPress's own option to save an HTML anchor on each Heading block as you write, so a link to a section stays the same if you later edit the heading. You can turn that off in the settings.