normaly we have to preserve the structure of the parent theme.
but for shortcodes we only have to make a subfolder in the child-theme-folder (normaly: enfold-child) called shortcodes and add this to functions.php of the child-theme:
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;
}
that works good – but what if we want to replace a php file in framework or includes folder?
I tried only to preserve hierarchical structure and make subfolders the same name in enfold-child.
I tested it with loop-index.php for a thread here on board – and it works without any snippet in the functions.php – is that ok- is it the usual way?
Or do we need a snippet too?
Hey Guenter,
That is the usual way, most of the themes do work like that to the folders that they allow to be modified ion a child theme,
Best regards,
Basilis
so shortcodes will also work without snippet if i make a folder in this way? :
enfold-child/config-templatebuilder/avia-shortcodes
Hi,
No, for shortcodes we do need the snippet, because we want to replace their function, it is a different usage than WordPress functions!
Best regards,
Basilis
thanks can be closed