我的html主题中有下一篇文章的链接:
<ul class="navigation">
<li class="previous">
<a href="previous.html" class="page-elements-title">prev</a>
</li>
<li class="next">
<a href="next.html" class="page-elements-title">next</a>
</li>
</ul>
CSS将这个链接转换为一个漂亮的按钮。
现在我想把这个代码应用到wordpress主题中。我试过了:
<ul class="navigation">
<li class="previous">
<a href="<?php echo get_next_posts_link(); ?>" class="page-elements-title">prev</a>
</li>
<li class="next">
<a href="<?php echo get_previous_posts_link(); ?>" class="page-elements-title">next</a>
</li>
</ul>
但它不起作用!我该如何解决这个问题?
previous_post_link and next_post_link is Deprecated
因此,不使用
<?php previous_post(); ?> <?php next_post(); ?>
参考代码x Next_and_Previous_Links