获取“第 X 页,共 Y 页” Wordpress 中的消息单.php
我想知道如何才能使 ie “第 2 页,共 13 页” 出现在 Wordpress 的 single.php 页面的底部。
假设用户单击首页上的帖子标题,当使用 single.php 打开该帖子时,用户会看到他所在的页面(以及总共有多少个页面)。因此,如果他选择查看第三篇帖子,则会显示“第 3 篇帖子,共 13 篇”。。如果他随后单击“下一个”或“上一个”,他会得到“第 2 个帖子(共 13 个)”或“第 4 个帖子(共 13 个)”等信息。
我已经设法在首页上做到这一点,但似乎无法让它在 single.php 上正常工作
。我想要这样做的原因是在上一个箭头和下一个箭头之间有消息。
I'm wondering how i can make i.e 'Page 2 of 13' appear on the bottom of Wordpress' single.php page.
Let's say a user clicks a post title on the front page, and when it's opened with single.php the user sees what page he's on (and also how many are total). So if he chooses to view the third post it would say 'Post 3 of 13'. If he then clicks Next or Previous, he gets 'Post 2 of 13', or 'Post 4 of 13' and so on.
I've managed to do this on the front page, but can't seem to get it working properly on single.php
The reason i want this is to have the message between a prev and next arrow.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您是否尝试过
posts_nav_link();
以前的帖子();
下一个帖子();
请参阅此处
Have you tried
posts_nav_link();
previous_post();
next_post();
Refer here
这是一个可以在侧边栏中使用的简单方法:
Here's an easy way that will work in your sidebar: