Table of Contents with a shortcode

The easiest way would be to replace

$content = $toc . $content;

with

$content = str_replace( '[toc]', $toc, $content );

This would do a search for the string [toc] and replace it with the table of contents.

It might be more complicated due to how the plugin would work, but on paper it is simple.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)