Tagged: fatal error, not found, TOC
Hi
I added a while back the following code to display the TOC, with the help of you guys.
add_shortcode('toc', 'avs_toc_function');
function avs_toc_function() {
$args = array (
'name' => 'Displayed Everywhere',
'id' => 'av_everywhere',
'description' => '',
'class' => '',
'before_widget' => '<details> <summary>Table of Contents</summary><section id="avia_auto_toc-2" class="widget clearfix avia_auto_toc">',
'after_widget' => '<span class="seperator extralight-border"></span></section></details>',
'before_title' => '',
'after_title' => '',
'widget_id' => 'avia_auto_toc_custom',
'widget_name' => 'Enfold Child Table of Contents',
);
$instance = array (
'title' => ' ',
'exclude' => '',
'style' => '',
'level' => 'h2',
'single_only' => 0,
'indent' => 1,
'smoothscroll' => 1,
);
ob_start();
$toc = new avia_auto_toc;
$toc->widget($args, $instance);
$output = ob_get_clean();
return $output;
}
After the latest update i get the error Fatal error: Uncaught Error: Class ‘avia_auto_toc’ not found
if i comment the code, the pages loads but the TOC is not showing.
I have a lot of posts that uses this shortcode to present the TOC.
Can you help figure out a solution.
Thank you
Hey TheBiZWeavers,
$toc = new avia_auto_toc;
replace with
$toc = new \aviaFramework\widgets\avia_auto_toc;
We added our widgets into namespace \aviaFramework\widgets\.
Best regards,
Günter
Hi Günter,
Cool, thank you for your quick reply.
That worked ;)
Thank you :)