Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1334283

    Hi,

    I used the instructions on this thread https://kriesi.at/support/topic/table-of-contents-widget-how-to-show-it-on-top-of-the-content-of-a-post-or-page/ and I can add the shortcode to the page, And the TOC is appearing.

    But it’s always placed as the first thing on the page instead where the shortcode is (more below into the content).

    Can you help figure out a way to fix it?

    Thanks

    #1334308

    Hey TheBiZWeavers,

    Thank you for the inquiry.

    Look for this line in the custom shortcode..

    $toc = new avia_auto_toc;
    return $toc->widget($args, $instance);
    

    .. and replace it with.

    
    ob_start();
    $toc = new avia_auto_toc;
    $toc->widget($args, $instance);
    $output = ob_get_clean();
    
    return $output;
    

    Let us know if that helps.

    Best regards,
    Ismael

    #1335077

    hi Ismael,

    Sorry for the response delay and tyvm, because your answer worked like a charm.

    Thank you again

    til next time

    Cheers

    #1335190

    Hi,

    No problem. Glad to know that the changes above worked. Please feel free to open another thread if you need anything else. We will close this one for now.

    Have a nice day.

    Best regards,
    Ismael

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘TOC shortcode always showing on the top of the page’ is closed to new replies.