• hwp2299

    (@hwp2299)


    Hello,

    I’m creating a custom block to output <?php echo do_shortcode('[toc]'); ?>. (I’m using the Lazy Blocks plugin for custom block creation.) After updating to version 2402.1, the table of contents stopped displaying. It works when I directly write the shortcode in Gutenberg, but issues arise when using the custom block. Downgrading to 2311 restores the table of contents display.

    • I have reconfigured the TOC settings after the update.
    • Confirmation has been made that the shortcode invocation via Lazy Blocks is functioning correctly.
    • It seems that files like front.min.js are not being loaded.
    • Checking the relevant post types under “Auto insert for the following content types” makes it work similarly to the previous version. However, I do not wish to display the table of contents for all posts.

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • conjur3r

    (@conjur3r)

    Hi, this month’s versions introduced a way to limit output of JSS and CSS on pages when the TOC settings didn’t warrant for a TOC to be created. This meant that for shortcodes it checks for use within the content. As yours is via programmatic means, it wouldn’t qualify as it can’t find ‘[toc]’ use within the content.

    A dumb question, are you not able to use ‘[toc]’ within the content? What benefits does doing it via lazy blocks have over doing it the traditional way?

    Does the TOC appear and it’s just the CSS and JS files that don’t load?

    andvsb

    (@andvsb)

    Hi, I have a similar problem.
    When I use auto insert in posts the page that collects the posts (blog page) made via elementor does not work correctly. Elementor blog, made by Premium Addons for Elementor, takes as excerpt the toc instead of the post content.
    So I disabled auto insertion and put the shortcode directly in my post template but unfortunately it doesn’t work.

    Thanks

    • This reply was modified 12 months ago by andvsb.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘After the update, TOC shortcode called within the custom block is not working.’ is closed to new replies.