Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #165912

    I need to modify a function that is defined in the ‘avia_sc_gallery’ class. The class is defined here:

    wp-content/themes/enfold/config-templatebuilder/avia-shortcodes/gallery.php

    The function I need to modify is shortcode_handler(). I tried to define the class in the child theme’s function.php, but apparently the ‘aviaShortcodeTemplate’ class that ‘avia_sc_galler’ extends does not exist at the time that the child theme’s function.php is being processed.

    Is there a ‘cool’ way to do this with the child theme, or do I really need to modify the file in the enfold theme itself?

    Thanks!

    • This topic was modified 11 years, 2 months ago by bspeice.
    #166970

    Hi bspeice!

    You can just add your own version of shortcodes to the child them in a shortcodes folder. Add this function to your functions.php first:

    add_filter('avia_load_shortcodes', 'avia_include_shortcode_template', 15, 1);
    function avia_include_shortcode_template($paths)
    {
    	$template_url = get_stylesheet_directory();
        	array_unshift($paths, $template_url.'/shortcodes/');
    
    	return $paths;
    }

    Then it will check your child theme shortcodes folder and if there is a shortcode file in there use that instead of the parent.

    Regards,
    Devin

Viewing 2 posts - 1 through 2 (of 2 total)
  • The topic ‘How do I override an avia framework class definition using enfold-child?’ is closed to new replies.