Hey all,
So I’m using jQuery with WordPress for the first time. I have included the jquery file in my header.php file like this:
wp_enqueue_script('jquery');
which works a treat.
Then, after the wp_head(); function, I have written a very basic script:
<script type="text/javascript">
$(document).ready(function() {
$('.children').hide();
});
</script>
It doesn’t run.
Now, if I look at the source code of the web-page, everything looks good.
On the console of Chrome, I get the following error message:
Uncaught TypeError: Property ‘$’ of object [object DOMWindow] is not a function
This is referring to the script that I have written. The jquery file runs fine.
Has anyone experienced something like this before? I haven’t a clue what’s happening here.
Many thanks,
Mike