Title: Toc doesnt show with Shortcode
Last modified: December 15, 2020

---

# Toc doesnt show with Shortcode

 *  [seowerk](https://wordpress.org/support/users/seowerk/)
 * (@seowerk)
 * [5 years, 5 months ago](https://wordpress.org/support/topic/toc-doesnt-show-with-shortcode/)
 * Hey there,
 * if I use the auto-insert(page) function it works everywhere…
    but if I want to
   use the shortcode [joli-toc] in my avada website on the exact same place like
   the auto-insert function would use nothing happens.
 * The # links are added to my headings but the Toc is missing.
    The same happened
   on another system with wpbakery. I tried it on the linked page and on [https://experts4energy.com/plug-and-play-solaranlage/](https://experts4energy.com/plug-and-play-solaranlage/).
   There it did work with a shortcode. Why is my Toc missing on the page when it
   actually works?
 * Thank you!
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Ftoc-doesnt-show-with-shortcode%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Plugin Author [WPJoli](https://wordpress.org/support/users/wpjoli/)
 * (@wpjoli)
 * [5 years, 5 months ago](https://wordpress.org/support/topic/toc-doesnt-show-with-shortcode/#post-13803719)
 * Hi,
 * I believe the wpbakery builder uses shortcodes behind the scenes to render heaadings.
 * It turns out for the Joli TOC shortcode rendering, at some point the page content
   is processed before shortcodes rendering. The logic is a bit complex and I’m 
   sure it can be improved but in the mean time, can you try the following and let
   me know if it works ?
 * Add this to your theme’s functions.php :
 *     ```
       add_filter('joli_toc_post_content_preprocessing', function($content){
       	$content = str_replace(apply_filters('jolitoc_shortcode_tag', JTOC()::DOMAIN), '', $content);
       	return apply_filters('the_content', $content);
       });
       ```
   
 * Thanks!
 *  Thread Starter [seowerk](https://wordpress.org/support/users/seowerk/)
 * (@seowerk)
 * [5 years, 5 months ago](https://wordpress.org/support/topic/toc-doesnt-show-with-shortcode/#post-13807888)
 * Hey,
 * thanks for the code. It works now on WPBakery.
    [https://bornak.de/flutter-zukunft-app-entwicklung/#app-entwicklung-mit-dem-cross-plattform-framework-flutter](https://bornak.de/flutter-zukunft-app-entwicklung/#app-entwicklung-mit-dem-cross-plattform-framework-flutter)
 * Unfortunately the Ids are not added to the headings so the table of content doesnt
   scroll to the heading.
    Maybe my theme is overwriting the Joli class?
 * Also, I tried the same filter on my avada site but there my page is not loading
   correctly. [https://experts4energy.com/wallbox-foerderung/](https://experts4energy.com/wallbox-foerderung/)
 * Do you have an Idea for my avada site as well?
 * Thanks again!

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

The topic ‘Toc doesnt show with Shortcode’ is closed to new replies.

 * ![](https://ps.w.org/joli-table-of-contents/assets/icon-256x256.png?rev=3487088)
 * [Joli Table Of Contents](https://wordpress.org/plugins/joli-table-of-contents/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/joli-table-of-contents/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/joli-table-of-contents/)
 * [Active Topics](https://wordpress.org/support/plugin/joli-table-of-contents/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/joli-table-of-contents/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/joli-table-of-contents/reviews/)

## Tags

 * [wpbakery](https://wordpress.org/support/topic-tag/wpbakery/)

 * 2 replies
 * 2 participants
 * Last reply from: [seowerk](https://wordpress.org/support/users/seowerk/)
 * Last activity: [5 years, 5 months ago](https://wordpress.org/support/topic/toc-doesnt-show-with-shortcode/#post-13807888)
 * Status: not resolved