• juanwp22

    (@juanwp22)


    Hi, I have a site with more than 600 posts and I would like to use SimpleTOC. Is there any way to add SimpleTOC in all posts with some plugin or code? I use Generatepress premium.

    Thanks

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Marc Toensing

    (@marcdk)

    Since SimpleTOC is a block there is currently no way to do that. I hoped that by the time we all get a plugin that adds blocks systematically to posts. Maybe there is a plugin out there that I overlooked?

    Thread Starter juanwp22

    (@juanwp22)

    I do not know if there is a plugin for blocks. It would be different if this were a shortcode.

    Plugin Author Marc Toensing

    (@marcdk)

    Yes, but SimpleTOC is just a block. Nothing more and nothing less. There will never be a Shortcode for SimpleTOC.

    Plugin Author Marc Toensing

    (@marcdk)

    Closed

    Just pitching in. Many premium themes offer hooks, which you can use to insert a group of blocks in specific places (before post) on specific post types (blog posts).

    I, personally, use Blocksy, and should I want to add the TOC block to all blog posts, that would be my approach. Maybe even just on posts with a tag created for that purpose, and I would be able to switch the TOC on and off in bulk.

    While being out of scope here on .org, Generate Press Premium also offers hooks, you might want to look into that.

    @oldrup, we’ve faced this challenge, too.

    I believe the roadblock here is that SimpleTOC only parses post content at the time its block is added to a single post, and/or when (re)saving a post.

    In order for it to work in a template, like in a sidebar for example, I think it needs to parse and regenerate the TOC on every pageload. Despite this option being resource-intensive, some site owners require it. We use Kadence Blocks’ TOC for this. Couple of other options linked here (I have no affiliation with the site).

    SimpleTOC generates the TOC on the fly and does not need the block in Gutenberg to generate anything. So the sidebar approach would work.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘How to add SimpleTOC to all posts?’ is closed to new replies.