私はここでいくつかの調査を行っていますが、ほとんどのajaxとwordpressのトピックは私のものとは異なるように見えるため、この問題を解決する方法がわかりません。ほとんど私はサイトを持っています
http://dev.touch-akl.com/childsplay/
ブログセクションには、ajaxを使用して次の3つの投稿でロードしたいより多くのリンクを含む最新の3つのブログが表示されます。
私のjQueryは次のとおりです
loadPosts();
function loadPosts(){
var $loadBtn = $('.ajax-load a');
var $loadCont = $('#ajax-content');
var pageTitle = document.title;
$loadBtn.live("click",function(e){
e.preventDefault();
var sourceTarget = '#ajax-content .the-posts';
$this = $(this);
pageUrl=$this.attr('href');
$loadCont.fadeTo(500,0);
$loadCont.load(pageUrl+" "+sourceTarget, function(){
$loadCont.fadeTo(500,1);
if(window.history.replaceState){
document.title = pageTitle;
window.history.replaceState(null, pageTitle, pageUrl);
}
//loadJQUERY(sourceTarget);
}); // end ajax load
}); // end click function
}
とhtml
<div id="ajax-content">
<div class="the-posts">
<?php
// START A QUERY OF THE NEWS ITEM POSTS AND LOOP THAT THANGGGG
if ( get_query_var('paged') ) $paged = get_query_var('paged');
if ( get_query_var('page') ) $paged = get_query_var('page');
query_posts('posts_per_page=3&paged=' . $paged);
if (have_posts()) : while (have_posts()) : the_post(); ?>
<article class="three columns">
<h3>The Most Recent Post</h3>
<img class="blog-image" src="<?php bloginfo('template_url');?>/images/blog/blogs-post.jpg" alt="Childsplay">
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text.</p>
<a href="#">Read More</a>
</article>
<?php endwhile; ?>
<div class="navigation">
<span class="left ajax-load"><? previous_posts_link('← More Stuff') ?></span>
<span class="right ajax-load"><? next_posts_link('More Stuff →') ?></span>
</div>
<?php else : endif; ?>
<?php wp_reset_query(); // reset the query ?>
</div>
</div>
パーマリンクがワードプレスの次の投稿ボタンのデフォルトに設定されていても、ページが見つからないようです。
私のajaxのやり方はワードプレスにはあまり良くありませんか?私は人々が他の方法を使うのを見たことがありますが、私はそれらを完全には理解していません。