• Resolved primaledgehealth

    (@primaledgehealth)


    Hello,

    Can you please tell me how to troubleshoot the table of contents showing
    on this page: /keto-diet-guide/
    but not on this page: [ redundant link removed ]
    Both pages have the option enabled via the checkbox located under the wp editor. Where can I go from here?

    [ Please do not bump. ]

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Steven

    (@shazahm1hotmailcom)

    A TOC will not get inserted when the position it is set to insert on can not be found. By default, this is before the first heading.

    If that first heading is dynamically generated, for example, inserted by another plugin or script, it might not be found when ezTOC processes the TOC insert.

    Another reason the insert positional might not be found is due to third-party party page layout/builders. ezTOC is designed to work with either the Classic Editor or the Block Editor. Third-party page layout/builders can alter the text encoding so that the insert position can not be found.

    Similar to third-party page layout/builders, if a third-party plugin processes that page content in a way that changes the text encoding, the TOC insert position might not be found.

    If any of the above is true, generally, removing any extended characters such as dashed/hyphens from the insert position heading can help. If that does not, then changing the insert position to the top of the page should work.

    Lastly, and probably the most common reason for a TOC not to be generated and inserted is that the post/page does not meet the minimum requirements, i.e., the number of eligible headings.

    Marco

    (@chefspuntozero)

    @primaledgehealth I see a difference within the code of your pages.

    The one where ezTOC is working has every H2 tags left alone among P tags, while in the “broken” page every H2 is caged within other heading DIVs and an HEADER tag.

    Like this:

    <header class="mv-create-header">
    <div class="mv-create-title-wrap">
    <h2 class="mv-create-title mv-create-title-primary">Supplements</h2>
    </div>
    <div class="mv-create-description">
    <p>We take a minimalist approach to supplementation and think that it is best to get our nutrition directly from organic, bioavailable, minimally processed food. However, in certain situations, supplementation can be very beneficial.</p>
    </div>
    </header>

    While the other page is just:

    <p>some text</p>
    <h2>title content</h2>
    <p>some other text</p>

    I assume your page editor lets you add header blocks, which is what you have done in the Resources page. But this is probably getting too difficult for the plugin to detect, so I guess this might be the issue.

    Thread Starter primaledgehealth

    (@primaledgehealth)

    Many thanks to you both for helping with this issue! @chefspuntozero your insights are helpful!

    @shazahm1hotmailcom All points noted. This does clarify and identify the issue being that the first heading is inserted by another plugin. I have since added a normal h2 and am now trying to force show the TOC even though technically, there is not the minimum required headings. I have the h2 and h3 checked in the list located in the WP post editor, however, nothing shows frontend. There’s a note above these boxes that says “Using the advanced options below will override the global advanced settings”. I take this to mean that by checking these boxes, it will force show the TOC, which is exactly what I want. Am I wrong? Where do I go from here?

    Marco

    (@chefspuntozero)

    Yes Steven,
    I’m using WPBakery which is the block editor coming with the Uncode theme. You’ve been working on it when I first installed easyTOC, because I couldn’t properly make it work… ??
    But I’m sure you can’t remember about that, as it was almost 2 years ago! ??

    @primaledgehealth
    That note you’re referring to in the WP post editor means that those settings will take over the main plugin settings in “WPDashboard > Settings > Table of contents“.
    This dasboard page is also where you can set the minimum number of headers (just below “Position“) that eTOC have to consider for adding your ToC within the post.

    For example, if you set 3, but you only add 2 headers in your WP post, the Table of Content will not appear.
    You can also set which headers tags you want to be considered (in the “Advanced” box down below), among h1, h2, h3, h4, h5, h6.

    So if you check h2 and h3 while setting a minimum of 3 headers while your post content is as follows:

    <p>some text</p>
    <h1>title</h1>
    <p>some text</p>
    <h2><strong>header</strong></h2>
    <p>some text</p>
    <h3><strong>header</strong></h3>
    <h4>sub-header</h4>
    <p>some text</p>

    You actually have 4 headers, but only 2 are involved (h2 and h3), so your post doesn’t meet the minimum headers “requirement”, so it won’t show any ToC.

    You can try forcing it by using the shortcode which is [toc] if I recall well, but I assume your issue is coming from the nested tags…

    • This reply was modified 2 years, 9 months ago by Marco.
    • This reply was modified 2 years, 9 months ago by Marco.
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘TOC showing on some pages but not all’ is closed to new replies.