Sorry, that theme is not supported in this forum. The custom functions may conflict with WordPress core functionality. Please visit the site where you purchased the theme for support https://themeforest.net/item/avada-responsive-multipurpose-theme/2833226/support
Ah, the theme is not important, I am using that theme however, but I am looking at the hooks. But this code could work, with any theme, no?
No, ‘avada_after_main_container’ is a theme specific function.
Is a hook, ‘avada_after_main_container’
Yes, a hook, not function. It’s still theme specific.
Try add_action('avada_after_main_container', 'show_post_slider_layout_before');
after your function declaration.
HVWD is correct, commercial theme support is not provided in these forums. If the above does not help, you will need to seek support through your theme vendor.
Thank you, I will try that. To tell you the truth, it is only curiosity to be able to do this, NOT a job, for this, or any other theme. But the theme is irrelevant to this code to me, it is the idea of been able to insert a shortcode via a hook in a theme via function.php
Thank you for your help,
That’s fine, why you are doing something does not matter, but if you use theme specific hooks and have issues with them where you need help, you will be sent to the theme specific support channel of whatever theme you are using. Generally speaking, for maximum compatibility, try to find a hook to accomplish what you want that is from WP core.
It’s not advisable to alter a theme’s functions.php file unless you wrote the theme. Your custom code should either go into a child theme or custom site specific plugin. Many commercial themes are framework based and take up the one available child theme position, which means the only safe place for your code is a plugin. That said, it seems that a lot of commercial child themes are never updated (a security concern in itself), so altering such themes might not otherwise be a problem. Keep a backup of your work just in case it does get updated.