• Resolved Bas

    (@webcreationz)


    I’m working with your beautiful plugin, but I need this TOC outside of my content area. So I disable automatic placement from the plugin and used the following code:

    <?php get_header(); ?>
    <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    <div class="customdiv"><?php echo do_shortcode('[ez-toc]'); // Also tried [toc] ?></div>
    
    <div class="customdiv2">
    <h1><?php the_title(); ?></h1>
    <?php the_content(); ?>
    </div>

    The table is still loading nicely, but clicking on the links don’t work anymore. The url changes, the anchor link is still on them, but the Headings in the content are not getting the span ID’s that are needed to scroll to.

    <h2>Title x<span class=”ez-toc-section” id=”Title-x”></span></h2>
    This span is now not inserted when using the shortcode.

    Do you have any idea what setting I’m missing?

    • This topic was modified 4 years, 8 months ago by Bas.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Steven

    (@shazahm1hotmailcom)

    Sorry, but the shortcode must run within the the_content() context of the required in-page link can not be inserted because the eligibility logic will fail. One way to possibly circumvent is to drop the TOC widget in a sidebar you will not use.

    Thread Starter Bas

    (@webcreationz)

    Thanks! I’ve created a sidebar on the place where I used the shortcode and this works perfect again! Love the plugin.

    Steven

    (@shazahm1hotmailcom)

    Great alternative solution ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Using [toc] shortcode – Links are not working anymore’ is closed to new replies.