让 WordPress 显示每月存档的代码?
我们正在工作中设置 WP-MU,我的任务之一是在侧边栏中创建一个链接,该链接将转到显示每月存档的页面。
侧边栏不得包含存档列表,而只能包含指向按月显示存档的页面(由 WP 即时生成)的链接。
这可能很简单,但我花了几个小时浏览 Codex 和博客文章,但没有取得进展。
有人可以帮助我吗?
谢谢你, 弗兰克·卢克
We are setting up a WP-MU at work and one of my tasks is to make a link in the sidebar that will go to a page displaying a monthly archive.
The sidebar must not contain the archive list just a link to a page (generated on the fly by WP) that shows the archive by month.
This is probably simple, but I have spent hours going through Codex and blog posts and not making headway.
Can anyone help me?
Thank you,
Frank Luke
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
WordPress Codex:创建存档 应该解释如何生成每月存档页面本身。获取每月存档的模板标签是:
如果您按照创建存档 您只需在侧边栏模板中添加一个链接(即
sidebar.php
):使用适合您设置的 URI。
WordPress Codex: Creating an Archive should explain how to generate the monthly archive page itself. The template tag to get the monthly archives is:
If you then have your archives template setup according to Creating an Archive you should only need to add a link as so in the sidebar template (i.e.
sidebar.php
):with the appropriate URI for your setup.