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!

有帮助吗?

解决方案

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

许可以下: CC-BY-SA归因
scroll top