调用下一篇日志函数 代码<?php next_post_link(); ?>
这个是个链接格式
<a href="http://127.0.0.1/asd/uncategorized/287.html" class="next" title="标题"><span>内容</span></a>
怎么获取id 287 或者个287.html我想了2个方法
一个是用php调用数据库里的下一个ID 好像这个有点难。。还有一个是调用函数这个函数 用js寻找next 在截取 287 或者 287.html 请问高手哪个比较快比较好点 有时间的话顺便写个 让我参考下 谢谢!!
这个是个链接格式
<a href="http://127.0.0.1/asd/uncategorized/287.html" class="next" title="标题"><span>内容</span></a>
怎么获取id 287 或者个287.html我想了2个方法
一个是用php调用数据库里的下一个ID 好像这个有点难。。还有一个是调用函数这个函数 用js寻找next 在截取 287 或者 287.html 请问高手哪个比较快比较好点 有时间的话顺便写个 让我参考下 谢谢!!
$post = get_next_post($in_same_cat, $excluded_categories); if ( !$post )
return;
//就是下一个id ,
$post->ID其中的 $in_same_cat: 是否要在同一个分类下查找下一篇日志,$excluded_categories:排除掉这些分类查找下一篇的id2. js
var postid,
url = $('.next').attr('href').split('/');postid = url[url.length-1].split('.')[0];alert(postid)