0
我试图砌体适用于本批代码:砌体jQuery插件不工作
<?php
//If There Are No Posts In The DB
if(condition) : ?>
<p> There Are Currently No Posts On This Site.</p>
<?php
//If There Are Posts In The DB - Loop Through All The Posts
else : ?>
<div id="masonry-grid">
<div class="gutter-sizer">
<?php foreach ($a as $b) :
<div class="grid-item">
<img src="source/of/the/image">
</div>
<?php endforeach; ?>
</div>
</div>
<script>
$(document).ready(function(){
var $container = jQuery('#masonry-grid');
$container.masonry({
columnWidth: 200,
itemSelector: '.grid-item'
});
});
</script>
<?php endif;?>
它并不完全排队图像的方式砖石是假设。 我检查了我的课程和ID匹配as per here,并且我的jQuery + Masonry文件已正确加载(在单独的头文件中)as per here。
我在考虑这是否是文档中的代码放置问题,但更改它的位置似乎不能解决问题。