[WordPress] 外掛分享: Simple Sticky TOC

首頁外掛目錄 › Simple Sticky TOC
WordPress 外掛 Simple Sticky TOC 的封面圖片
全新外掛
安裝啟用
尚無評分
249 天前
最後更新
問題解決
WordPress 5.0+ PHP 7.2+ v1.0.1 上架:2025-08-09

內容簡介

總結:Simple Sticky TOC是一個輕量且移動端友好的WordPress外掛,通過解析<h2>、<h3>和<h4>標籤,自動生成單篇文章或頁面的粘性目錄。它無需jQuery,具備多項功能並支援主題覆寫。

問題與答案:
1. 什麼是Simple Sticky TOC?
- Simple Sticky TOC是一個WordPress外掛,用於自動生成單篇文章或頁面的粘性目錄,通過解析<h2>、<h3>和<h4>標籤實現。

2. Simple Sticky TOC有哪些特點?
- 可自動檢測並鏈接h2至h4標題
- 在桌面上採用垂直佈局的粘性目錄
- 在移動端展示可切換的粘性目錄
- 內建RTL支援(位置和佈局)
- 可在個別文章中禁用TOC的選項
- 可從主題自訂TOC佈局的選項
- 為標題自動生成錨點ID
- 乾淨的CSS、純JavaScript,無需jQuery

3. 如何支援主題覆寫?
- 複製外掛中的默認模板文件:
- frontend/partials/toc-template.php
- assets/css/toc.css
- assets/js/toc.js
- 粘貼到您的主題內以下文件夾中:your-theme/simple-sticky-toc/
- 支援重寫文件:
- simple-sticky-toc/toc-template.php – 自訂TOC標記
- simple-sticky-toc/toc.css – 自訂樣式
- simple-sticky-toc/toc.js – 自訂JavaScript行為

外掛標籤

開發者團隊

⬇ 下載最新版 (v1.0.1) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「Simple Sticky TOC」→ 直接安裝(推薦)
📦 歷史版本下載

原文外掛簡介

Simple Sticky TOC automatically generates a sticky table of contents for single posts or pages by parsing

,

, and

tags. It is lightweight, mobile-friendly, and works without jQuery.
Features:
– Automatically detects and anchors h2–h4 headings
– Sticky TOC with vertical layout on desktop
– Sticky toggleable TOC on mobile
– Built-in RTL support (positioning + layout)
– Option to disable TOC on individual posts
– Option to customize TOC layout from your theme
– Auto-generated anchor IDs for headings
– Clean CSS, pure JavaScript, no jQuery
Theme Override Support
To override the default markup or styles:

Copy the default template files from the plugin:

frontend/partials/toc-template.php
assets/css/toc.css
assets/js/toc.js

Paste them into your theme inside the following folder:

your-theme/simple-sticky-toc/

Supported override files:

simple-sticky-toc/toc-template.php – custom TOC markup
simple-sticky-toc/toc.css – custom styles
simple-sticky-toc/toc.js – custom JS behavior

延伸相關外掛

文章
Filter
Apply Filters
Mastodon