, 와타루의 Infinite Scroll with URL cycling Script
이 스크립트를 다운로드 바닥 글을 대기열 또는 꿀꺽 또는 그러나 당신이 그것을 사용하도록 선택할 함께 연결하여 사용합니다.
1) 구성과 같이 귀하의 게시물 내용 :
Single.php
<?php get_header(); ?>
<main id="post-left-col" class="relative infinite-container" role="main">
<?php if (have_posts()) : while (have_posts()) : the_post();
get_template_part('template-parts/post/content');
endwhile; endif;
?>
</main>
</div>
<?php get_footer(); ?>
content.php 워드 프레스에서 무한 스크롤을 구현하는 방법
,<?php
/**
* Template part for displaying posts
*/
?>
<article id="post-area" class="infinite-post">
<!-- Insert your post format here e.g. <h1><?php the_title; ?></h1> etc..
하면 content.php 포스트 템플릿의 끝에
<div class="navigation"><?php next_post_link(); ?></div>
포함해야합니다.
2) 무한 스크롤 구성을 설정하십시오. 이것은 물론 기본 자바 스크립트 파일에 포함될 수 있습니다. 아래의 선택기는 모두 이름이 변경 될 수 있습니다.
jQuery(document).ready(function($) {
$('.infinite-content').cleverInfiniteScroll({
contentsWrapperSelector: '.infinite-container',
contentSelector: '.infinite-post',
nextSelector: '.navigation a:first'
});
});
무한 스크롤 스크립트를 작성한 Paul Irish와 Wataru에게 감사드립니다.
안녕하세요, 귀하의 답변 주셔서 감사합니다,이 무한 스크롤을 작동하지만 URL을 변경 기능을하지 않습니다 (내 잘못은 질문에 명확하게하지 않았으므로). 정말로 감사드립니다. –