masonry only works if jquery is called twice

So I noticed that I'm loading jQuery twice in my WordPress install and when I removed the CDN I added in my footer and just use the jQuery WordPress comes with my masonry stopped working and gave the error:

Uncaught TypeError: $(...).masonry is not a function.

so then I tried using wp_enqueue_script('masonry'); and wp_enqueue_script('jquery-masonry'); to load WordPress's version of masonry, it still didn't work and also the script file wasn't loaded either. I'm not sure whats going on any help would be great thanks!

Topic masonry jquery Wordpress

Category Web


figured it out, turns out i was missing wp_footer() in my footer, once i added that i was able to solve my problem. thanks for the help

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.