• Resolved Besthand

    (@soft4fun)


    I use H4 as the main paragraph title, H5 as the sub-title, but the following case will cause incorrect TOC structure in front page.

    EX:

    <h4> This is main paragraph </h4>
    <h5> sub-title 1</h5>
    <h5> sub-title 2</h5>
    <h4> This is another main paragraph </h4>

    If correct, the TOC shows like:

    • This is main paragraph
      • sub-title 1
      • sub-title 2
    • This is another main paragraph

    but it shows:

    • This is main paragraph
      • sub-title 1
        • sub-title 2
        • This is another main paragraph

    How do I fix this problem?

    Thanks.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter Besthand

    (@soft4fun)

    This forum seems cant’t show correct level of list, please refer this image:

    https://imgur.com/uwW5e7j

    Plugin Author WPJoli

    (@wpjoli)

    Hello,

    Thank you for reporting this.

    For now, the algorythm works best when the structure of the headings is following the W3C standards.

    The title of the page should always be H1 (only one H1), followed by H2, H3 and so on, but skipping headings ranks is not considered best practice and it is best for SEO to keep a W3C compliant structure.

    Please refer to this link: https://www.w3.org/WAI/tutorials/page-structure/headings/

    Skipping heading ranks can be confusing and should be avoided where possible: Make sure that a?<h2>?is?not?followed directly by an?<h4>, for example.

    However, I understand the TOC should keep the proper structure even if it does not follow the standards, and I will have this fixed for the next update.

    In the mean time there is nothing to do if you want to keep your headings this way. Otherwise, changing your headings and starting from H2 will fix this.

    Thank you!

    Plugin Author WPJoli

    (@wpjoli)

    Hello,

    The heading level issue when not starting from H2 has been resolved in 2.0.3.

    Please update to the latest version and let me know.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Incorrect depth count’ is closed to new replies.