나는 무한한 책 (wordpress posts)의 스크롤을 만들고있다.무한 스크롤로 반복되는 게시물
을하지만 당신은 아래로 스크롤하면, "더로드 책"후,이 책이 다시 나타납니다 : 당신은 책의 첫 번째 행이 하나가 표시되는 경우.
그래서 처음부터 책 (워드 프레스 포스트)을로드하고 연속적으로 포스트를로드하지 않습니다.
books home [여기] [3]에서 잘 볼 수 있습니다.
문제는 입니다 (single.php) 어떤 책에 입력 한 후
문제이고, 내가 그것을 어떻게 해결할 수있는 어떤 생각?
<div id="infinite-scroll">
<div id="infite-activities">
<div class="row">
<?php
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$args=array("post_type"=>"books","posts_per_page"=>"12");
/* $args["paged"]=(get_query_var('paged')) ? absint(get_query_var('paged')) : 1; */
$args["paged"]=$paged;
if(is_single())
$args["orderby"]="date";
$books=new WP_Query($args);
while($books->have_posts()):$books->the_post();?>
<div class="col-lg-3 col-md-3 col-xs-12 col-sm-3">
<div class="book-grid-img">
<?php $default_attr = array('class' => "img-responsive");?>
<a href="<?php the_permalink();?>" title="<?php the_title();?>"> <?php the_post_thumbnail("books-grid",$default_attr);?></a>
</div>
<div class="box-desc-book">
<div class="book-title">
<?php the_title();?>
<span><?php the_field("autor");?></span>
</div>
</div>
<div class="book-download">
<a href="<?php the_permalink();?>">MORE INFO</a>
</div>
</div>
<?php endwhile;?>
<div class="pagination">
<?php
$big = 999999999; // need an unlikely integer
echo paginate_links(array(
'base' => str_replace($big, '%#%', esc_url(get_pagenum_link($big))),
'format' => '?paged=%#%',
'current' => max(1, get_query_var('page')),
'prev_text' => __('« Previous'),
'next_text' => __('Next »'),
'total' => $books->max_num_pages
));
?>
</div>
</div>
<script>
jQuery('#infinite-scroll').infinitescroll({
loading: {
finishedMsg: "<em>No more books.</em>",
msgText: "<em>Loading more books</em>"
},
navSelector : "a.next",
nextSelector : "a.next",
itemSelector : "#infite-activities",
debug : true,
dataType : 'html',
maxPage : 5,
path: function(index) {
return "page/" + index + "/?test=1";
}
}, function(newElements, data, url){
});
</script>
현재 어떤 작업이 작동하지 않는지도 모릅니다. 그 점을 분명히하십시오. – Daniel
@Daniel 아래로 스크롤하면 게시물이 반복됩니다. – codek
SO-Badges는 이미 SE 학습자가있는 것처럼 보입니다. 따라서 FAQ에서 다시 한 번 살펴보고 실제 결과와 대비하여 원하는 결과를 명료하게 표현하십시오. – Daniel