kunoichi/toc-generator
最新稳定版本:1.0.3
Composer 安装命令:
composer require kunoichi/toc-generator
包简介
TOC generator from h1-h6 tags.
README 文档
README
Generate table of contents from h1-h6 tags.
Installation
Run composer.
comopser require kunoichi/toc-generator
And include autoloader.
require __DIR__ . '/vendor/autoload.php';
Usage
PHP
W.I.P
WordPress
In your functions.php
// Register TOC. // If you have theme option for it, // detect conditions. add_action( 'init', function() { $parser = new Kunoichi\TocGenerator\WpParser(); $parser->set_title( __( 'Table of Contents', 'your-theme' ) ); } );
And render TOC where you want(e.g. In your singular.php).
You need $post_id to render TOC.
In this case, get_queried_object_id() is used.
Kunoichi\TocGenerator\WpParser::render( get_queried_object_id() );
统计信息
- 总下载量: 8.81k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: GPL-3.0-or-later
- 更新时间: 2019-09-02