Found it: echo do_shortcode(‘[toc]’).
But anchors does not work in this case.
In the console: “ezTOC scrollTarget Not Found: [id=”Anchor”]”
Thanks
-
This reply was modified 4 years, 5 months ago by
giudansky.
I’m also looking for this function!
can someone answer us?
Some more info. Do_shortcode does not work with [toc] because its executing it outside of the_content(). It working as a shortcode inside blobks.
But i want toc right after the article title, in a custom layout together with article infos and author.
It looks like its gonna work in a sidebar but its not clear for me how to do it.
Use the included functions:
Ensure the post type is enabled, but the auto insert is disabled in the settings, so the headings have the anchors added.