Wordpress 侧边栏中的持久帖子名称
我需要始终在我的 WordPress 主题的侧边栏中显示我的所有帖子标题。现在它仅在我浏览类别时才有效(它显示该类别的所有帖子标题)。但是,当我单击帖子时,只有该帖子标题保留在我的侧边栏中,而侧边栏不应该具有这样的功能。
你能帮我一下吗?
预先非常感谢您! 赫里斯托
I need to display all my post titles in the sidebar of my Wordpress theme all the time. Just now it works only when I am browsing a category (it shows all post titles from that category). But when I click on a post, only this post title remains into my sidebar, which is not supposed to function like that.
Could you help me, please?
Thank you very much in advance!
Hristo
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您能够自己编写一个插件,使用 WordPress 的 API 这非常容易,您可以为自己制作一个小部件,使用 the_loop() 函数打印所有帖子标题。
如果您制作了自己的主题,您甚至可以将其集成到您的functions.php 文件中,然后在侧边栏模板中输出标题。
要从数据库查询帖子,您将需要 query_posts() 函数,您也可以在其中过滤您帖子的某些字段。
If you are able to write a plugin yourself, which is quite easy using the API of WordPress, you can make yourself a widget that uses the the_loop() function to print out all post titles.
If you have made your own theme, you can even integrate it into your functions.php file and then output the title within your sidebar template.
To query the post from the database you will need the query_posts() function, where you can also filter on some fields of your posts.