內容簡介
**總結:**
這個外掛提供了一個自動建立錨點連結清單的功能,將文章中的標題設置為可快速連結的目標。
**問題與答案:**
1. 如何在文章中使用「Auto Anchors Links List」這個區塊?
- 將「Auto Anchors Links List」區塊插入想要顯示的地方即可。
2. 一篇文章中可以包含幾個「Auto Anchor Links List」區塊?
- 一篇文章只能包含一個「Auto Anchor Links List」區塊。
3. 如何檢視並測試自動產生的連結清單?
- 預覽文章以查看清單顯示和測試連結。
4. 支援哪些標題級別的設置?
- 支援 h2 到 h6 級別的標題。標題級別必須按照正確的順序排列,子標題級別在清單中有縮排。
5. 如何手動維護清單?
- 如果要手動維護清單,需將區塊中的「auto-anchor-links-list」類別移除,將其轉換為 WordPress 核心清單區塊。
6. 如何設置特定標題的錨點文本?
- 將「Manual Anchor」區塊樣式應用於標題,然後設置其錨點文本屬性為 `[空]`(不包含在自動錨點清單中)或`[“custom-anchor”]`(包含在自動錨點清單中)。
7. 如何排除特定標題不在自動錨點清單中?
- 在任何標題區塊中添加「no-auto-anchor」類別即可排除不包含在自動錨點清單中。
外掛標籤
開發者團隊
原文外掛簡介
A block that automatically creates a list of anchor links to headings in a post.
Usage
Insert the “Auto Anchors Links List” block where you’d like it to appear. A post can only contain one “Auto Anchor Links List” block. Preview the post to view the list display and test links.
Heading levels h2-h6 are supported. Heading levels (h2 -> h3 -> h4) must be ordered properly; sub-heading levels are indented in the list.
The “Auto Anchors Links List” block is automatically updated when headings in the post are modified. Any manual edits to the list will be overwritten. To maintain the list manually, remove the “auto-anchor-links-list” class from the block to transform it into a WordPress core list block.
Additional Controls
Apply the “Manual Anchor” block style to a heading and then set its anchor text attribute to:
[empty] A plain heading tag (omitted from auto anchors list)
[“custom-anchor”] A persistent custom anchor; useful for permalinks (included in auto anchors list)
Add a “no-auto-anchor” class to any heading block to omit it from auto anchors list.
