开发者

Test if there are older posts in wordpress

I've got this function:

<?php next_posts_link( __( '<span class="meta-na开发者_如何学编程v">&larr;</span> Older posts') ); ?>

It creates a link if there are older posts. How do I do something on the condition that there are no older posts? Anything I do that uses this function only seems to echo the link.


Simply add a get_ to the function :)

<?php 
if (get_next_posts_link()) {}
?>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜