Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1348814

    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

    #1348835

    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

    #1348839

    Hi Günter,

    Cool, thank you for your quick reply.

    That worked ;)

    Thank you :)

    #1348842

    Hi,

    Thanks for your feedback.

    Glad we could help you. Enjoy the theme and have a great day.

    Feel free to come back whenever you need assistance.

    Best regards,
    Günter

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Fatal error: Uncaught Error: Class 'avia_auto_toc' not found’ is closed to new replies.