开发者

Test if there are older posts in wordpress

开发者 https://www.devze.com 2023-01-07 13:31 出处:网络
I\'ve got this function: <?php next_posts_link( __( \'<span class=\"meta-na开发者_如何学编程v\">&larr;</span> Older posts\') ); ?>

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

精彩评论

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