棘手的一個在這裏(我認爲)..我使用Isotope For Wordpress插件拉我的帖子到同位素網格。除了我一直無法獲得任何Adding Methods的工作,所有的工作都很完美。這是我想要什麼(與增加三個新的職位,以網格的目標):添加項目與同位素爲WordPress插件
var $container = $('.mintthemes_isotopes_container');
var $items = $('<div class="hentry" /> <div class="hentry" /> <div class="hentry" />');
$('#insert').click(function() {
$('.mintthemes_isotopes_container').isotope('insert', $items);
});
$container.imagesLoaded(function(){
$container.isotope({
animationEngine: 'best available',
transformsEnabled: true,
itemSelector: '.hentry',
masonry: {
columnWidth: 1,
gutterWidth: 5
},
});
我想我的問題出在什麼IM定義是什麼$項目是。上面的代碼添加了三個新的容器,樣式正確,但沒有內容。我想我需要調用實際的帖子而不是「.hentry」,但我不確定如何在插件提供的.js文件中執行該操作。這裏是如何在我的index.php中發佈帖子:
<?php mintthemes_isotopes(); ?>
<?php
// Blog post query
$linksPosts = new WP_Query();
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
query_posts(array('post_type' => 'post', 'paged'=>$paged, 'showposts'=>3));
if (have_posts()) : while (have_posts()) : the_post();?>
<div <?php post_class(); ?>>
<div class=".mintthemes_isotopes_container">
<div class=".isotope-item">
<p><a href="<?php the_permalink(); ?>" title="<?php the_title();?>"><?php the_title();</p></a>
</div> <!-- /isotope item -->
</div> <!--/.mintthemes_isotopes_container-->
</div> <!-- /.post_class -->
<?php endwhile; endif; ?>
我無法調用該php post_class();在一個外部的.js文件中?有沒有其他方法可以稱爲這些帖子?任何和所有的想法讚賞。