Below, you’ll find a detailed guide on how to add the Joli Table Of Contents Shortcode to your WordPress website, including its parameters, examples, and PHP function code. Additionally, we’ll assist you with common issues that might cause the Joli Table Of Contents Plugin shortcode not to show or not to work correctly.
Before starting, here is an overview of the Joli Table Of Contents Plugin and the shortcodes it provides:
"Joli Table Of Contents is a versatile WordPress plugin designed to create organized and easily navigable table of contents for your blog posts or pages."
- [joliTOCShortcode]
Joli Table Of Contents [joliTOCShortcode] Shortcode
The joli-table-of-contents plugin shortcode is a function that generates a table of contents for a post. It retrieves the post using the ID and builds the shortcode content.
Shortcode: [joliTOCShortcode]
Examples and Usage
Basic Example – A simple usage of the joli-table-of-contents shortcode. This will generate a table of contents for the current post or page.
[jolitoc]
PHP Function Code
In case you have difficulties debugging what causing issues with [joliTOCShortcode]
shortcode, check below the related PHP functions code.
Shortcode line:
add_shortcode(apply_filters('jolitoc_shortcode_tag', Application::DOMAIN), [$this, 'joliTOCShortcode']);
Shortcode PHP function:
function joliTOCShortcode($atts = [])
{
$post = get_post(get_the_ID());
$shortcode = $this->buildShortcodeContents($post);
return $shortcode;
}
Code file location:
joli-table-of-contents/joli-table-of-contents/v1/core/Controllers/ShortcodesController.php
Conclusion
Now that you’ve learned how to embed the Joli Table Of Contents Plugin shortcode, understood the parameters, and seen code examples, it’s easy to use and debug any issue that might cause it to ‘not work’. If you still have difficulties with it, don’t hesitate to leave a comment below.
Leave a Reply