Tagged: child theme, javascript, jQuery
Hi,
I am trying to add custom javascript with a child theme to avoid losing it when updating the theme, but I cannot find a post explaining how to do it.
If I create an avia.js file in a js folder inside the child theme it does not seem to trigger. Am I missing something?
Hi Xavier!
You can use wp_enqueue_script, please take a look: http://codex.wordpress.org/Function_Reference/wp_enqueue_script
Cheers!
Josue
Hello,
i’m not familiar with php,
how can i had
avia.js, and particulary this code :
jQuery(“.iconlist_icon”).each(function(){
var theLink = jQuery(this).siblings(“article”).find(“.iconlist_title a”).attr(“href”);
if(theLink) {
jQuery(this).on(“click”, function(){
window.location.href = theLink;
});
}
});
to my enfold child theme ?