<div class="contents">
<?php if(have_posts()):while(have_posts()):the_post();?>
<div class="post"></div>
<div class="post"></div>
<div class="post"></div>
<div class="post"></div>
<?php endwhile;?>
</div>
<div class="ajaxLoad">
<?php next_posts_link('more');?>
</div>
<script>
$(function(){
$.autopager({
content: '.post',
link: '.ajaxLoad a',
autoLoad: false,
load:function(current, next){
if(current.page>=<?phpecho$wp_query->max_num_pages;?>){$('.ajaxLoad').hide();}
}
});
$('.ajaxLoad a').click(function(){
$.autopager('load');
return false;
});
});
I use the WordPress plug-in wp-jquery-lightbox
I use jquery-autopager
for pageation, but
lightbox
will no longer work after page 2
May I ask you?
I think the reason is that there is no lightbox event on the dom read by ajax.
Therefore, it should be activated by re-addling the lightbox after loading dom.
However, I am not familiar with autopager and lightbox, so please check the library separately to determine after loading ajax and run the lightbox.
Maybe it works below...
$.autopager({
......
load:function(current, next){
......
doLightBox()
}
});
© 2024 OneMinuteCode. All rights reserved.