隨着無限滾動我試圖一次加載3個職位,但只有填寫具體領域(視頻)的職位。無限滾動與if/else語句
因此,例如,我的最新2篇文章已填寫字段(視頻),3d文章沒有,第4篇文章有。 我要發佈1,2 & 4加載原因,使得3.然後無限滾動應該加載未來3個職位,包括視頻等
無限滾動的作品,分頁查詢的工作,但是:由於後3沒有按」噸有視頻領域填寫,無限滾動只加載職位1 & 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>"
}
});
嗨,有Hobo, 你是對的!我在幾小時前就明白了這一點,並且工作。我結束了上面的答案... – inTOWN