• Hello SimpleTOC Support Team,

    I have encountered a bug regarding how SimpleTOC handles headings inside a post loop on a static homepage.

    The Issue: When using a Query Loop block (GenerateBlocks) on my static Homepage, SimpleTOC incorrectly parses the post titles within the loop. Instead of generating unique IDs based on the actual post headings, it applies the parent homepage’s slug (e.g., id="domu") to every single heading inside the loop.

    This creates multiple identical IDs on the same page, breaking HTML validation and accessibility.

    Context:

    • This issue occurs strictly on the static Homepage.
    • It seems the plugin is trying to parse and filter content outside of the standard is_singular('post') context and takes the global post object (the homepage itself) as the source for the ID generation.

    Feature Request / Fix: Could you please fix the context detection so it ignores Query Loop blocks, or add a simple “Display Rule” option in the settings to strictly disable SimpleTOC on the front page / archives?

    Thank you for your time and for looking into this!

Viewing 1 replies (of 1 total)
  • Plugin Author Marc Tönsing

    (@marcdk)

    Thanks for the report. SimpleTOC is greedy by design: it adds IDs to every heading it finds in the content, so headings inside a query loop get processed too. Could you tell me why SimpleTOC is active on your homepage, and share an example (URL or the block structure)? Does the homepage contain a SimpleTOC block? Meanwhile you can exclude the loop with the simpletoc_excluded_blocks filter. I’ve also reproduced the duplicate IDs on my side and have a small fix ready, so query loops would be skipped by default.

Viewing 1 replies (of 1 total)

You must be logged in to reply to this topic.