Plugin Author
WPJoli
(@wpjoli)
Hi,
I assume you toggle the visibility from a Divi standpoint ? are you using the Divi builder within the theme?
Are you using the shortcode or auto-insert ?
Also,would you mind sharing an URL where the problem happens ? If you don’t want to show it publicly, please send it to hello@wpjoli.com
I may have an idea why this occurs but it will be easier to tell with a real example.
Thank you
Thread Starter
Ivo
(@ivokruchten)
Thank you for looking into this.
I use the Divi builder, and I toggled the visibility in the DIvi builder (Thus, yes, from a Divi standpoint).
I’m using the shortcode. (I made a page template for detail pages and inserted the shortcode to show a toc on every detail page with more than 4 headers.)
Please take a look at https://library.maastrichtuniversity.nl/visit/hours-locations/
Under “on this page” (left sidebar) , under “Library today” you can see 2 Inner city, Randwyck and Tapijn. These are headers that are not visible (made invisible from within the Divi builder).
Plugin Author
WPJoli
(@wpjoli)
Thank you for the extra details.
So I think I know what is going on here, only I may need to come out with a fix in an update soon.
To make sure this is the problem I’m thinking of, can you please try the following:
Paste this piece of code in your theme’s functions.php and let me know how the TOC comes out:
add_filter('joli_toc_post_content_preprocessing', function ($content) {
$content = str_replace(apply_filters('jolitoc_shortcode_tag', JTOC()::DOMAIN), '', $content);
if (version_compare(JTOC()::VERSION, '2.0.4', '<=')) {
return apply_filters('the_content', $content);
}
return $content;
});
One more question, are you using the shortcode from a sidebar widget (Appearance > Widgets) ?
Thanks!
Thread Starter
Ivo
(@ivokruchten)
Hi,
I have added the PHP script and the problem of the invisible headers is fixed. You can see it for yourself at the link above, thanks!
I have add the shortcode [joli-toc] to the template, so without using a widget.
Plugin Author
WPJoli
(@wpjoli)
Okay, great !
When this issue is fixed in the next version, you can remove this code.
To make sure nothing breaks, I have already added a version check as extra security, and the code will stop working after version 2.0.4 anyways, but then you should not need it anymore.