插入的Wordpress帖子在RSS Feed中显示错误的日期 [英] Inserted Wordpress Post Shows Bad Date In RSS Feed

查看:63
本文介绍了插入的Wordpress帖子在RSS Feed中显示错误的日期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们的wordpress博客(当前为3.4.2版)具有一个外部过程,该过程可将帖子直接从第三方插入数据库中.我没有能力改变它,所以不要费心告诉我不应该那样做.我可以更改插入语句.

Our wordpress blog (currently version 3.4.2) has an external process that inserts posts directly into the database from a third party. I don't have the ability to change that, so don't bother telling me it shouldn't be done that way. I CAN change the insert statements though.

帖子显示出来,并且一切看起来都很好,除了RSS feed在日期字段中显示了无效的年份(期望是2013,而不是-0001):

The posts show up and everything looks fine except that the RSS feed shows an invalid year (expecting 2013, instead getting -0001) in the date field:

<pubDate>Wed, 30 Nov -0001 00:00:00 +0000</pubDate>

该帖子的wp_posts表中的post_date字段显示正确的日期,并且在网站上该帖子具有正确的日期.它按时间顺序显示在正确的位置.

The post_date field in the wp_posts table for the post shows the correct date, and on the site the post has the right date. It shows up in the right place chronologically.

如果我使用控制面板手动编辑帖子,甚至仅更改一秒钟就更改日期,然后重新发布该帖子,则它会修复供稿.

If I manually edit the post using the control panel and change the date even by just one second and re-publish the post then it fixes the feed.

此问题导致RSS提要无法验证,并且破坏了其他内容.救命!

This problem causes the RSS feed to not validate, and it's breaking other things. Help!

推荐答案

每个WP帖子存储4个日期:Post_date,post_date_gmt,post_modified和post_modified_gmt.

There are 4 dates stored for each WP post: Post_date, post_date_gmt, post_modified and post_modified_gmt.

我建议您为post_date和post_modified插入相同的日期,看看是否可行.

I recommend you to insert the same date for both post_date and post_modified and see if it works.

这篇关于插入的Wordpress帖子在RSS Feed中显示错误的日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆