Title: Shortcode Table of Contents
Author: jamesckemp
Published: <strong>Bélú 29, 2017</strong>
Last modified: Agẹmọ  31, 2018

---

Ṣàwárí àwọn plugin

![](https://ps.w.org/shortcode-toc/assets/banner-772x250.png?rev=1778245)

Plugin yìí **kò tíì ṣe àyẹ̀wò pẹ̀lú àwọn ìtújáde mẹ́ta pàtàkì tó kẹ́yìn ti WordPress**.
Ó lè jẹ́ pé a kò tọ́jú tàbí ṣe àtìlẹ́yìn fún un mọ́, ó sì lè ní àwọn ọ̀ràn ìbámu
nígbà tí a bá lò ó pẹ̀lú àwọn ẹ̀yà WordPress tuntun.

![](https://ps.w.org/shortcode-toc/assets/icon-256x256.png?rev=1778245)

# Shortcode Table of Contents

 Láti ọwọ́ [jamesckemp](https://profiles.wordpress.org/jamesckemp/)

[Ṣe ìgbàsílẹ̀](https://downloads.wordpress.org/plugin/shortcode-toc.zip)

 * [Àwọn àlàyé](https://yor.wordpress.org/plugins/shortcode-toc/#description)
 * [Àwọn àgbéyẹ̀wò](https://yor.wordpress.org/plugins/shortcode-toc/#reviews)
 *  [Ìgbéwọlẹ̀](https://yor.wordpress.org/plugins/shortcode-toc/#installation)
 * [Ìdàgbàsókè](https://yor.wordpress.org/plugins/shortcode-toc/#developers)

 [Ìrànlọ́wọ́](https://wordpress.org/support/plugin/shortcode-toc/)

## Àpèjúwe

Simply use the `[toc content=".your-container"]` shortcode to automatically generate
a table of contents for any HTML container.

The shortcode accepts a number of parameters:

 * `content` _string_ **required**
    A CSS selector indicating the container of your
   content.
 * `headers` _string_
    A comma separated list of heading selectors that you want
   to include.
 * `speed` _int_
    Speed of sliding back to top.
 * `anchor-class` _string_
    Class of anchor links.
 * `anchor-text` _string_
    Prepended or appended to anchor headings. Leave blank
   to disable anchor links.
 * `top_class` _string_
    Back to top button or link class.
 * `spy` _true/false_
    Enable scroll spy. This will highlight the list items as 
   you scroll past them.
 * `position` _append/prepend_
    Position of anchor text.
 * `spy-offset` _int_
    Specify heading offset for spy scrolling.

## Àwọn àwòrán ìbòjú

 * [[
 * Add the `[toc]` shortcode to any post/page/custom-post-type, at any position 
   in the content.
 * [[
 * A nested list will be generated based on the headings within your chosen HTML
   element.
 * [[
 * Add the `anchor-text` parameter.
 * [[
 * When the `anchor-text` parameter is set, the text will be appended to your headings
   so your users can easily copy the link to that section.

## Ìgbéwọlẹ̀

 1. Upload the plugin files to the `/wp-content/plugins/shortcode-toc` directory, or
    install the plugin through the WordPress plugins screen directly.
 2. Activate the plugin through the ‘Plugins’ screen in WordPress

## FAQ

  Installation Instructions

 1. Upload the plugin files to the `/wp-content/plugins/shortcode-toc` directory, or
    install the plugin through the WordPress plugins screen directly.
 2. Activate the plugin through the ‘Plugins’ screen in WordPress

  Can I use the shortcode multiple times on a page?

No. Currently itÌtumọ̀ Yorùbá: ’ll only work once per page.

  The table of contents isnÌtumọ̀ Yorùbá: ’t showing up.

Did you set the `content` parameter of the shortcode to a valid CSS selector on 
your page? This is a required argument.

  Can I build a table of contents for just h2 and h3 tags?

Yup, your shortcode would look like this `[toc content=".your-container" headers
="h2,h3"]`

  Is there a PHP version of the shortcode?

You can use the `do_shortcode()` function like this:

    ```
    <?php echo do_shortcode( '[toc content=".your-container"]' ); ?>
    ```

## Àwọn àgbéyẹ̀wò

![](https://secure.gravatar.com/avatar/ec90659e38270e106cb6c0b4ee0c3a35a735ed8b76aff7c0d3cc5dbdb4f48378?
s=60&d=retro&r=g)

### 󠀁[No cyrillic](https://wordpress.org/support/topic/no-cyrillic-3/)󠁿

 [hlammm](https://profiles.wordpress.org/hlammm/) Èrèlé 26, 2019

It does not work if the site is in Cyrillic.

![](https://secure.gravatar.com/avatar/8e95c0528a1959250adbcf5d38b78b8b4ddbbacc1410e786f1a23d6c4271bea2?
s=60&d=retro&r=g)

### 󠀁[Filter shortcode presets](https://wordpress.org/support/topic/filter-shortcode-presets/)󠁿

 [nenontwerp](https://profiles.wordpress.org/nenontwerp/) Ọ̀wàrà 28, 2018

Great simple plugin! There are no filters available to set shortcode defaults. My
clients dont know the right class names to set the parameter ‘content’. So if you
want to set the default class for ‘content’ or set the default set of headers, use
filter ‘shortcode_atts_{shortcode}’. This way you the shortcode get much cleaner
like ‘[toc]’. If the parameters in the shortcode are set, the default are over ruled.
Filter like: add_action('shortcode_atts_toc','nen_shortcode_atts_toc'); function
nen_shortcode_atts_toc( $out ) { if( isset( $out['content'] ) && empty( $out['content']))
$out['content'] = '.entry-content'; if( isset( $out['headers'] ) && $out['headers']
== 'h1, h2, h3, h4, h5, h6' ) $out['headers'] = 'h2, h3, h4'; return $out; } Hopefully
James Kemp can apply a filter to add custom content before and/or after the div ‘
shortcode-toc’. This way we can add a custom toc-header or something. Thanx!

![](https://secure.gravatar.com/avatar/d97589e1287a4c27a39be552da7473323c1e697a9a6abf2d18d81935e5debfd5?
s=60&d=retro&r=g)

### 󠀁[So simple and useful! Does what it promises 🙂 Thx bro!](https://wordpress.org/support/topic/so-simple-and-useful-does-what-it-promises-thx-bro/)󠁿

 [smith64fx](https://profiles.wordpress.org/smith64fx/) Ògún 30, 2018

IÌtumọ̀ Yorùbá: ’m really happy with it ^^

![](https://secure.gravatar.com/avatar/524156a645b53e512d163867db3acf844fcff4c68d44feced01e13041e0acad4?
s=60&d=retro&r=g)

### 󠀁[Just what I need](https://wordpress.org/support/topic/just-what-i-need-94/)󠁿

 [resident82](https://profiles.wordpress.org/resident82/) Òkúdù 2, 2018

I needed to make navigation for posts, and this is a ready-made automated solution.
Many thanks.

![](https://secure.gravatar.com/avatar/a4f72aa0ad82961554b9ecfa3201df9d41fc777704856ff00b710363284e0b4d?
s=60&d=retro&r=g)

### 󠀁[Lightweight & versatile](https://wordpress.org/support/topic/lightweight-versatile/)󠁿

 [](https://profiles.wordpress.org/t4tsu/) Ọ̀pẹ 28, 2017 1 ìdáhùn

Very lightweight and at the same time versatile enough with useful options.

![](https://secure.gravatar.com/avatar/ef861245e900fd7b6cfdab595980ad7597ea6f9973c4fc0a9dca3afbbf5c223b?
s=60&d=retro&r=g)

### 󠀁[the best TOC](https://wordpress.org/support/topic/the-best-toc/)󠁿

 [drweby2](https://profiles.wordpress.org/drweby2/) Ọ̀pẹ 26, 2017 1 ìdáhùn

the best TOC

 [ Ka gbogbo àwọn àgbéyẹ̀wò 6 ](https://wordpress.org/support/plugin/shortcode-toc/reviews/)

## Àwọn Olùkópa & Olùgbéejáde

“Shortcode Table of Contents” jẹ́ ètò ìṣàmúlò orísun ṣíṣí sílẹ̀. Àwọn ènìyàn wọ̀nyí
ti ṣe ìkópa sí plugin yìí.

Àwọn Olùkópa

 *   [ jamesckemp ](https://profiles.wordpress.org/jamesckemp/)

[Túmọ̀ “Shortcode Table of Contents” sí èdè rẹ.](https://translate.wordpress.org/projects/wp-plugins/shortcode-toc)

### Ṣe o nífẹ̀ẹ́ sí ìdàgbàsókè?

[Ṣàwárí koodu](https://plugins.trac.wordpress.org/browser/shortcode-toc/), ṣàyẹ̀wò
[ibi ìpamọ́ SVN](https://plugins.svn.wordpress.org/shortcode-toc/), tàbí ṣe àgbékalẹ̀
sí [àkọsílẹ̀ ìdàgbàsókè](https://plugins.trac.wordpress.org/log/shortcode-toc/) 
nípasẹ̀ [RSS](https://plugins.trac.wordpress.org/log/shortcode-toc/?limit=100&mode=stop_on_copy&format=rss).

## Àkọsílẹ̀ àwọn àyípadà

**v1.0.3 (31/07/2018)**
 [fix] Revert back to original anchorific. Bower one was
an old version.

**v1.0.2 (01/12/2017)**
 [update] Use latest anchorific.

**v1.0.1 (30/11/2017)**
 [update] Remove anchor text by default. [fix] Ensure ‘spy’
param works with true/false values.

**v1.0.0 (29/11/2017)**
 [release] Initial release.

## Àkójọpọ̀ Meta

 *  Ẹ̀yà **1.0.3**
 *  Ìgbàgbọ́hùn tó kẹ́yìn **ọdún 8 sẹ́yìn**
 *  Àwọn ìgbéwọlẹ̀ tó ṣiṣẹ́ **300+**
 *  Ẹ̀yà WordPress ** 4.0 tàbí ju bẹ́ẹ̀ lọ **
 *  Dánwò dé **4.9.29**
 *  Èdè
 * [English (US)](https://wordpress.org/plugins/shortcode-toc/)
 * Àwọn àmì
 * [anchors](https://yor.wordpress.org/plugins/tags/anchors/)[table of contents](https://yor.wordpress.org/plugins/tags/table-of-contents/)
   [toc](https://yor.wordpress.org/plugins/tags/toc/)
 *  [Ìwòye Tó Péye](https://yor.wordpress.org/plugins/shortcode-toc/advanced/)

## Àwọn ìbò

 4.7 lára àwọn ìràwọ̀ 5.

 *  [  5 5-star reviews     ](https://wordpress.org/support/plugin/shortcode-toc/reviews/?filter=5)
 *  [  0 4-star reviews     ](https://wordpress.org/support/plugin/shortcode-toc/reviews/?filter=4)
 *  [  1 3-star review     ](https://wordpress.org/support/plugin/shortcode-toc/reviews/?filter=3)
 *  [  0 2-star reviews     ](https://wordpress.org/support/plugin/shortcode-toc/reviews/?filter=2)
 *  [  0 1-star reviews     ](https://wordpress.org/support/plugin/shortcode-toc/reviews/?filter=1)

[Your review](https://wordpress.org/support/plugin/shortcode-toc/reviews/#new-post)

[See all reviews](https://wordpress.org/support/plugin/shortcode-toc/reviews/)

## Àwọn Olùkópa

 *   [ jamesckemp ](https://profiles.wordpress.org/jamesckemp/)

## Ìrànlọ́wọ́

Nǹkan wà tí o fẹ́ sọ? Ṣé o nílò ìrànlọ́wọ́?

 [Wo àpéjọ ìrànlọ́wọ́](https://wordpress.org/support/plugin/shortcode-toc/)

## Ṣe ìtọrẹ

Ṣé o fẹ́ ṣe àtìlẹ́yìn fún ìlọsíwájú plugin yìí?

 [ Ṣe ìtọrẹ sí plugin yìí ](https://www.paypal.me/jamesckemp/)