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

    I’ve created a custom avia-shortcode, it all works (fantastically easily to extend by the way, amazing work!).

    Instead of having it stored in /enfold/config-templatebuilder/avia-shortcodes I was wondering if it’s possible to put it in my enfold-child theme directory so that if (for whatever reason) I need reinstall Enfold I won’t lose my custom avia shortcodes.

    I tried recreating the folder structure in the child theme but that didn’t seem to work.

    Any ideas?

    #587963

    Hey scottybowl!

    If you want to overwrite an existing shortcode create a “shortcodes” folder within the child theme directory, then copy the /wp-content/themes/enfold/config-templatebuilder/avia-shortcodes/masonry_entries.php into the child theme “shortcodes” folder and modify the php code. At least add following code into the child theme functions.php file

    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;
    }

    This code will make sure the the shortcode file of the child theme is loaded first and you can overwrite the parent theme slideshow shortcode file with the child theme.

    Best regards,
    Basilis

    #588379

    Brilliant, thank you for your help!

    #588817

    Hi,

    Glad we could help :-)

    Best regards,
    Rikard

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.