• Resolved varun0007

    (@varun0007)


    Hi, I have facing one issue in the TOC block in Gutenberg builder. I have used current year shortcode(%year%) in the content headings, Like this:https://prnt.sc/26q4igs. When the TOC gets the heading from the content then the heading shortcode(%year%) is converted with the simple text to year instead of the current year. In this TOC heading screenshot https://prnt.sc/26q4ls0 the year is working through shortcode but the link is working as a simple year text. Can you please suggest to me how I can customize the “ultimate-addons-for-Gutenberg” plugin files or any more suggestions to solve this.

    https://dev.aksjebloggen.com/toc-test/
    Authentication details are:
    User: development
    Pass: development

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

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hello @varun0007 ,

    I have visited your site and I am not able to see any TOC on this page. Did you remove it?

    Looking forward to hearing from you.

    Thread Starter varun0007

    (@varun0007)

    Thanks for the confirmation, Can you please check again? The page URL is working fine now:
    https://prnt.sc/26vlujk
    https://dev.aksjebloggen.com/toc-test/

    • This reply was modified 3 years ago by varun0007.

    Hello @varun0007 ,

    I’d suggest you to kindly create a simple shortcode function for this purpose. Just add the following filter in the functions.php file of your child theme and you are ready to go:

    function current_year() {
        $year = date('Y');
        return $year;
    }
    
    add_shortcode('year', 'current_year');

    Then you will be able to put [year] to anywhere in the content area.

    I hope that helps.

    Hello @varun0007 ,

    We haven’t heard back from you in a while, so I’m going to mark this as resolved – if you have any further questions, you can start a new thread.

    Thank you!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Table Of Content is not working for the shortcode heading in gutenberg.’ is closed to new replies.