我试图一次加载3个职位,
So for example, my latest 2 posts have the field (video) filled out, the 3d post has not, the 4th post has. I want post 1, 2 & 4 loaded cause that makes 3. Then infinite scroll should load the next 3 posts that include video, etc.
无限的卷轴工作, 平面查询工作, 但是: 因为第3号后没有填好视频字段, 无限的卷轴只加载 1 & amp; 2, 不添加 4 来完成我想要的 3 个职位...
我的代码:
<div id="interviews">
<?php $temp = $wp_query;
$wp_query= null;
$wp_query = new WP_Query();
$wp_query->query( paged= .$paged. &cat=5&showposts=3 );
while ($wp_query->have_posts()) : $wp_query->the_post();
echo ( <ul id="infinite"> );
if (get( video_video , 1, TRUE)) {
echo ( <li class="video"> );
$home = array("h" => 290, "w" => 380, "zc" => 1, "q" =>100);
//echo get( video_video );
echo ( With: );
echo get( participant_first_name );
echo ( );
echo get( participant_last_name );
echo ( </li> );
}else{ $video_video=false;
echo ( );
} ?>
<?php endwhile;?>
</ul>
<?php if ($wp_query->max_num_pages > 1) : ?>
<nav id="nav-below">
<div class="nav-previous"><?php next_posts_link( __( ← More , intowntheme ) ); ?></div>
</nav>
<?php endif; ?>
</div><!--End interviews-->
Jquery 脚本 :
jQuery( #interviews ).infinitescroll({
navSelector : "#nav-below", // selector for the paged navigation (it will be hidden)
nextSelector : "#nav-below .nav-previous a", // selector for the NEXT link (to page 2)
itemSelector : "li.video", // selector for all items you ll retrieve
extraScrollPx: 50,
loading : {
msgText: "<em>Loading the next year of Grantees...</em>",
finishedMsg: "<em>You ve reached the end of the Grantees.</em>"
}
});