Hello.

I'm trying to run the Masonry script on the site under wordpress, but I just can't do it. Chrome stubbornly issues "Uncaught ReferenceError: Masonry is not defined".

I tried to connect and via function.php (the script must be embedded in wp)

function mason_script() { wp_enqueue_script('masonry'); } add_action( 'wp_enqueue_scripts', 'mason_script' ); 

I tried to just display in the header

 <script src="http://masonry.desandro.com/masonry.pkgd.min.js"></script> <script> 

Always a mistake.

Tell me, pliz, what could be wrong?

Example - https://jsfiddle.net/gpt46yac/

    1 answer 1

    1. <script> must be added to the markup, not to the script.

    2. It seems that they are not going to give so file.

    3. There is no content-type .

    Transfer to your server and use from there. Or on pastbin.

    • From my server I also called - through the developer tools in chrome everything opens, no 404. I updated the code with an example - jsfiddle.net/gpt46yac/6 Anyway, the script does not work - Den