JQuery code not working on theme
-
Hi,
I am using a theme called Kleo. I need to write some custom jQuery code so which I have used using wp_enqueue_scripts and using jquery as a dependency (https://codex.www.ads-software.com/Function_Reference/wp_enqueue_script#Link_a_Theme_Script_Which_Depends_on_jQuery)
My custom js file is called and if I do a console.log it works fine. However any kind of jQuery is not working. For example:
jQuery(“#logo_img”).css(“display”, “none”);
(using ‘$’ will give an error in console)
Using this kind of code I don’t have any kind of errors showing in console and I’m not sure why it’s not working (#logo_img does exist). If I type that above code in console it does work.
Any help is much appreciated, thanks!
- The topic ‘JQuery code not working on theme’ is closed to new replies.