Is there a way to add more content elements in the builder? Hooks or filters that I can tap into with my custom functions file?
You just need to place your element into the wp-contentthemesenfoldconfig-templatebuilderavia-shortcodes folder. The template builder will initialize it automatically.
Thanks for the feedback Peter. But doing this will be written over when the theme is updated correct? I’m using a child theme currently.
It depends on how you update the theme. If you just overwrite the old files with the new, update files (eg by using ftp) the custom elements won’t be affected (or only if we add a file with the same file name – however the risk is not very high :) ). However if you delete the entire theme folder first you need to make a backup of the elements.
You can also try to place the element code/class into a child theme but I’m not sure if this works out because all elements extend the “aviaShortcodeTemplate” class and if the template builder plugin is not loaded (which can happen because the child theme functions.php will load first) then you’ll probably get an error. In this case I’d recommend to copy the content of functions.php to your child theme and to set the “use_child_theme_functions_only” to “true” (see comment at the top of functions.php).
$avia_config['use_child_theme_functions_only'] = true;
Thanks again Peter.
That is what I was afraid of. Maybe in the near future making it a bit more extensible with a child theme would be more helpful for some of us not wishing to mess with the main theme files.
Just read the addition to your previous post (adding that is an option) Something I’ll look into.
On that note, maybe there is a way that if the user creates a folder “avia-shortcodes’ in the child theme directory that the theme checks for that folder when the builder is ran and looks for the additional code/classes? Just a thought.
The topic ‘More "Content Elements"’ is closed to new replies.