私は次のページセットでロードするためにループ+ jQueryを使用しています。最初のクリックでは動作しますが、次のページがロードされて「新しい投稿」をクリックするとページ全体をリロードします。何か案は?単純なWordpress AJAXページ設定
<div id="content">
<?php
$new_query = new WP_Query();
$new_query->query('post_type=post&showposts=1'.'&paged='.$paged);
?>
<?php while ($new_query->have_posts()) : $new_query->the_post(); ?>
<?php the_title(); ?>
<?php endwhile; ?>
<div id="pagination">
<?php next_posts_link('« Older Entries', $new_query->max_num_pages) ?>
<?php previous_posts_link('Newer Entries »') ?>
</div>
</div><!-- #content -->
<script>
$('#pagination a').on('click', function(event){
event.preventDefault();
var link = $(this).attr('href'); //Get the href attribute
$('#content').fadeOut(500, function(){ });//fade out the content area
$('#content').load(link + ' #content', function() { });
$('#content').fadeIn(500, function(){ });//fade in the content area
});
</script>
これは、任意のアイデアを私のために改ページのリンクを作成しないのだろうか?また、あなたの$ページの価値は何ですか?コードからは見えません。 – trainoasis