wordpress the_date 方法 偶尔为空的问题

估计很多人遇到这个问题:

  • 一来是the_title(),the_permalink(),the_date()一路用下来,很正常也很正确
  • 不爱读官方文档,因为文档中有个特别提示

文档:http://codex.wordpress.org/Template_Tags/the_date

SPECIAL NOTE: When there are multiple posts on a page published under the SAME DAY, the_date() only displays the date for the first post (that is, the first instance of the_date()). To repeat the date for posts published under the same day, you should use the Template Tag the_time() or get_the_date() (since 3.0) with a date-specific format string.

翻译:

特别说明 ︰ 当同一天发布多篇文章时,the_date() 只显示的日期的第一篇 (就是 the_date()) 的第一个实例。要重复日期根据同一天发布的文章,你应该使用模板标签 the_time() 或 get_the_date();

posted @   码不能停  阅读(274)  评论(0编辑  收藏  举报
编辑推荐:
· 如何编写易于单元测试的代码
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
阅读排行:
· 周边上新:园子的第一款马克杯温暖上架
· Open-Sora 2.0 重磅开源!
· 分享 3 个 .NET 开源的文件压缩处理库,助力快速实现文件压缩解压功能!
· Ollama——大语言模型本地部署的极速利器
· [AI/GPT/综述] AI Agent的设计模式综述
点击右上角即可分享
微信分享提示