• Resolved Bookman53

    (@bookman53)


    I use Twentig with Twenty Twenty Two. I have a strange issue happening with any table of contents plugin that I use. I have tried at least three different ones and get similar results with all of them.

    The table of contents works fine on desktop using any of the plugins. (Two plugins provide blocks. One provides a short code that I place with the short code block.)

    On mobile, the table of contents is present, but in every case all of the links act as they are null links.

    With one plugin, clicking a link in the TOC will cause a little jump about 1/2 line high.

    With the second plugin, clicking any link in the TOC results in the page immediately scrolling straight to the top, rather than down the appropriate heading.

    With the third plugin, nothing happens except the normal font color change when hovering or clicking.

    Any idea what might be causing this?

    Again, any of the TOCs work exactly as expected on desktop. All misbehave on mobile.

    Thanks.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Twentig

    (@twentig)

    Hi,

    Thanks for your feedback. Would you please try to deactivate the Twentig plugin and see if the problem persists (if that’s the case, the issue is not related to Twentig). If the issue only happens when Twentig is activated, would you please share the name of the plugins so I can test them?

    Please note that WordPress 6.1 (to be released on November 1) will include a table of contents block.

    Thanks.

    Thread Starter Bookman53

    (@bookman53)

    I’ve discovered that the problem with the table of contents not working was due to a bad design choice on my part.

    A hint from one of the TOC creators led me to the solution. I had inserted two post content blocks in the template and styled one for mobile (hidden from desktop and tablet) and the other for desktop (hidden from mobile). Bad idea!

    The TOC blocks were looking for headings and finding two of each because there were effectively two copies of the article in the code, leaving them with no idea which one was the correct one.

    Thank you for your help on this one.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Table of Contents not working on mobile’ is closed to new replies.