【发布时间】:2013-02-26 12:54:57
【问题描述】:
我在 jquery 选项卡中遇到了一些分页问题。我使用了 Ajax 分页,因为它工作得很好,但不幸的是,当我第二次点击任何页面时(分页中)。然后它破坏了链接。 请看前视图它是如何工作的: http://kelts.wpengine.com/7664-top-o-the-morning-312/ 打开最近的相关帖子->点击任意分页页面
请确保我使用的是 wp-pagination();.
<script type="text/javascript">
jQuery(".larger.page").live("click", function(e) {
e.preventDefault();
var href = jQuery(this).attr("href");
show_posts(href.replace(/.*page\//, ""));
});
show_posts(1);
});
function show_posts(l) {
jQuery.get("<?php bloginfo('template_directory')?>/fetch-blog-post.php", {
pageno : l
}, function(data) {
jQuery("#show_posts").html(data).show();
});
}
</script>
【问题讨论】:
-
这是我的代码 这是我的代码:
-
编辑你的问题,这是不可读的。
-
语法错误,
show_posts(1);后面的});无效
标签: php jquery ajax wordpress jquery-plugins