Tagged: Enfold child
-
AuthorPosts
-
May 4, 2018 at 5:48 pm #951795
Hi,
I have a problem with the enfold child. For example I edited the file /js/avia.js regarding the ajax search in widgets. Problem is. when I make the exact same folders within enfold child and put it in there it won’t work. Only when i change the avia.js in the parent theme. But when I do this, i can never update enfold again.
What do I do wrong? I downloaded the enfold child provided here.
Kind regards
May 7, 2018 at 9:39 pm #952900Hey Mac-TR,
Please add the following code
if(!is_admin()) add_action('wp_enqueue_scripts', 'avia_register_child_frontend_scripts', 100); function avia_register_child_frontend_scripts() { $child_theme_url = get_stylesheet_directory_uri(); wp_dequeue_script('avia-default'); //register js wp_register_script( 'avia-default-child', $child_theme_url.'/js/avia.js', array('jquery'), 1, true); wp_enqueue_script( 'avia-default-child' ); }
to get it load from your child theme
Best regards,
BasilisMay 8, 2018 at 2:01 pm #953372Hi,
thank you Basilis. If I read the code correctly the part starting with register .js I would have to make with every php or js file I change from the parent theme correct? And i guess you mean to add it into the functions.php of the child?
- This reply was modified 6 years, 6 months ago by Mac-TR.
May 9, 2018 at 11:20 pm #954204Hi,
Yeap, that is correct.
That works for the JS files.
If you need to load shortcodes from the child theme, then you need to use the followingadd_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; }
Best regards,
BasilisMay 11, 2018 at 12:21 am #954942Thank you very much. I think I got it. :)
May 11, 2018 at 3:54 am #954976May 14, 2018 at 5:37 pm #956551Hi,
yeah you can close it. Thanks again :)
Also want to say you guys built a wonderful theme with really clean code
May 15, 2018 at 3:25 am #956777Hi,
Glad we were able to help, we will close this now. Thank you for using Enfold.For your information, you can take a look at Enfold documentation here
And if there are features that you wish Enfold had, you can request them and vote the requested ones here
For any other questions or issues, feel free to start new threads under Enfold sub forum and we will gladly try to help you :)Best regards,
Mike -
AuthorPosts
- The topic ‘Enfold Child doesn't work’ is closed to new replies.