Masonry - imagesLoaded - Not a function
<p><code>Masonry</code> and <code>imagesLoaded</code> should be loaded and work correctly. A similar site has been made, and there it works correctly. I have no idea where my problem is, so I am hoping that you maybe see the problem. There should be something missing.</p>

<p>In Chrome Inspect I get the following error:</p>

<pre><code>Uncaught TypeError: $(...).imagesLoaded is not a function
</code></pre>

<p>By what I have understood this means that <code>.imagesLoaded</code> and <code>Masonry</code> should be correctly loaded? Else I would have recieved the error <code>$container.imagesLoaded is not a function</code> ?</p>

<p><strong>What I have tried</strong></p>

<ul>
<li>Checking if jquery-2.1.4.min.js is properly loaded</li>
<li>Changing the order of when the jquery is loaded</li>
<li>Searching online</li>
<li>Searching for errors within the jquery</li>
</ul>

<p><strong>Header</strong></p>

<pre><code>&lt;script src="http://www.vekvemedia.no/wp-content/themes/vekvemedia/js/jquery-2.1.4.min.js"&gt;&lt;/script&gt;
&lt;script src="http://www.vekvemedia.no/wp-content/themes/vekvemedia/js/collection.js"&gt;&lt;/script&gt;
&lt;?php wp_head(); ?&gt;
</code></pre>

<p><strong>HTML</strong></p>

<pre><code>&lt;div class="container"&gt;
    &lt;div id="masonry-container" class="row nomargin"&gt;
         &lt;div class="col-md-9"&gt;
              &lt;div class="item col-lg-4 col-md-4 col-sm-4"&gt;
                   &lt;!--- Content ---&gt;
              &lt;/div&gt;
              &lt;div class="item col-lg-4 col-md-4 col-sm-4"&gt;
                   &lt;!--- Content ---&gt;
              &lt;/div&gt;
              &lt;div class="item col-lg-4 col-md-4 col-sm-4"&gt;
                   &lt;!--- Content ---&gt;
              &lt;/div&gt;
         &lt;/div&gt;
         &lt;div class="item col-lg-3 col-md-4 col-sm-3 col-xs-12"&gt;
              &lt;!--- Content ---&gt;
         &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;
</code></pre>

<p><strong>Footer</strong></p>

<pre><code>&lt;script src="http://www.vekvemedia.no/wp-content/themes/vekvemedia/js/masonry.pkgd.min.js"&gt;&lt;/script&gt;
&lt;script src="http://www.vekvemedia.no/wp-content/themes/vekvemedia/js/imagesloaded.js"&gt;&lt;/script&gt;

&lt;script&gt;
  $('#masonry-container').imagesLoaded( function(){
    $('#masonry-container').masonry({
     itemSelector: '.item',
     isAnimated: true,
     isFitWidth: true
    });
  });
$(window).resize(function() {
    $('#masonry-container').masonry({
        itemSelector: '.item',
        isAnimated: true
    }, 'reload');
});
&lt;/script&gt;
</code></pre>

<p><a href="http://www.vekvemedia.no/aktuelt/" rel="nofollow">The page can be found here.</a></p>

<p><a href="http://roonabegum.no" rel="nofollow">A similar page where it works</a></p>