| 开发者 | nazmulasif |
|---|---|
| 更新时间 | 2026年7月27日 01:32 |
| PHP版本: | 7.4 及以上 |
| WordPress版本: | 7.0 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
[flexitoc] for classic content and page builders, including Elementor and Divi.nav landmark, native details collapsing (no JS), aria-current on the active link, reduced-motion respected.hidden, aria-hidden) are ignored automatically.flexitoc-include, flexitoc-exclude (or no-toc) on headings or their containers; flexitoc-ignore on a container to skip everything inside it.flexitoc_headings (the list an instance will show), flexitoc_html (final markup), flexitoc_settings (effective settings).[flexitoc] shortcode.No measurable impact on pages without a TOC — no CSS or JS loads unless a TOC actually renders. Even where it does, the stylesheet is small and the optional scroll-spy script (only loaded if you enable "highlight current section") is under 1 KB.
Yes, really free, and it stays that way. There is no Pro tier, no feature paywall, and no upsell nags. Every feature described on this page — automatic insertion, per-heading control, sticky sidebar, the works — is in the free plugin, permanently.
By default it needs at least 2 eligible headings (configurable). A TOC listing one entry is noise, so the automatic mode skips it — but a block or shortcode you placed yourself always renders.
Select the heading block and use its "Table of contents" panel — or open FlexiTOC Headings in the document sidebar to manage all of them at once. In the classic editor or a page builder, add the flexitoc-include / flexitoc-exclude CSS class instead.
Levels are the default; explicit choices win. A heading you explicitly include shows even if its level isn't selected, and one you exclude never shows. Headings you never touched simply follow the effective levels (block setting → per-post setting → site default).
No. Anchor ids are injected at render time only. Your stored content is never touched.
Yes — the FlexiTOC block works in widget areas, template parts and Site Editor templates, and shows the TOC of the post being viewed. Enable Sticky and "Highlight current section" for a documentation-style sidebar.
[flexitoc title="Contents" levels="2,3" list="ol" hierarchy="flat" collapse="closed" sticky="1" scrollspy="1" class="my-class"] — every attribute is optional; anything you omit inherits the global settings. list accepts ul (bulleted), ol (numbered), or none (no marker). hierarchy accepts nested (default) or flat (single level — best for sidebars).
Open FlexiTOC Display in that post's sidebar and choose "Do not auto-insert" (or a different position for just that post). Manual blocks and shortcodes are not affected.
editorScript/style/editorStyle references, which WordPress.org's plugin-directory scanner needs to detect and list a plugin's blocks (the "Blocks" section on the plugin page, and visibility in the block editor's "Available to install" search). The actual script/style registration is unchanged -- these are handled in PHP as before, for translations and settings-aware localization -- this only makes them statically visible to the directory's scanner.the_content more than once for the same post; the plugin now caches its own processed output per post for the request so a second call can't strip a custom heading label a second time with nothing left to restore it from.ol correctly showed numbers, but ul had no matching override and stayed markerless). Bullets now render for the Bulleted style, both on the front end and in the editor preview.