{"id":1352,"date":"2007-10-17T00:26:32","date_gmt":"2007-10-17T08:26:32","guid":{"rendered":"http:\/\/www.krunk4ever.com\/blog\/2007\/10\/17\/wordpress-last-updated-time-fix-for-atom-rss-feed\/"},"modified":"2007-10-17T00:42:04","modified_gmt":"2007-10-17T08:42:04","slug":"wordpress-last-updated-time-fix-for-atom-rss-feed","status":"publish","type":"post","link":"https:\/\/www.krunk4ever.com\/blog\/2007\/10\/17\/wordpress-last-updated-time-fix-for-atom-rss-feed\/","title":{"rendered":"WordPress Last Updated Time Fix for Atom RSS Feed"},"content":{"rendered":"<p>I noticed for the longest time that updates to my blog posts wouldn&#8217;t propagate over to Bloglines. Digging a bit deeper I noticed that in my atom feed, the &lt;updated&gt; and the &lt;published&gt; timestamps were the same. Looking at the code generating those 2 lines revealed the problem:<\/p>\n<blockquote><p><code>&lt;updated&gt;&lt;?php the_time('c'); ?&gt;&lt;\/updated&gt;<br \/>\n&lt;published&gt;&lt;?php the_time('c'); ?&gt;&lt;\/published&gt;<\/code><\/p><\/blockquote>\n<p>It used the same code to generate the updated time and the published time. I scratched my head trying to figure out if there was a way to determine the last modified time for a particular post\/entry. I didn&#8217;t want it to just returned the last modified time for the entire database, which is what the atom feed uses for the feed&#8217;s last modified time.<\/p>\n<p>Searching online, I found this bug on WordPress: <a href=\"http:\/\/trac.wordpress.org\/ticket\/4816\">Atom feed entry updated field should use get_post_modified_time, not get_post_time<\/a>. Apparently the correct thing to call is:<br \/>\n<code>get_post_modified_time('Y-m-d\\TH:i:s\\Z', true);<\/code><\/p>\n<p>Resulting in:<\/p>\n<blockquote style=\"text-align: left;\"><p><code>&lt;updated&gt;&lt;?php echo get_post_modified_time('Y-m-d\\TH:i:s\\Z', true); ?&gt;&lt;\/updated&gt;<br \/>\n&lt;published&gt;&lt;?php the_time('c'); ?&gt;&lt;\/published&gt;<\/code><\/p><\/blockquote>\n<p>Yep. That fixed my atom feed&#8217;s entry last updated time. Obviously I&#8217;m not using the latest WordPress version and although updating WordPress isn&#8217;t difficult, it&#8217;s not easy either. Updates should be fast and simple. One click that does back up, download newest version, install, and prompt me for any extra things I need to configure. If anything goes wrong, roll back to what it was previously.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I noticed for the longest time that updates to my blog posts wouldn&#8217;t propagate over to Bloglines. Digging a bit deeper I noticed that in my atom feed, the &lt;updated&gt; and the &lt;published&gt; timestamps were the same. Looking at the code generating those 2 lines revealed the problem: &lt;updated&gt;&lt;?php the_time(&#8216;c&#8217;); ?&gt;&lt;\/updated&gt; &lt;published&gt;&lt;?php the_time(&#8216;c&#8217;); ?&gt;&lt;\/published&gt; It &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.krunk4ever.com\/blog\/2007\/10\/17\/wordpress-last-updated-time-fix-for-atom-rss-feed\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;WordPress Last Updated Time Fix for Atom RSS Feed&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[11],"tags":[],"_links":{"self":[{"href":"https:\/\/www.krunk4ever.com\/blog\/wp-json\/wp\/v2\/posts\/1352"}],"collection":[{"href":"https:\/\/www.krunk4ever.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.krunk4ever.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.krunk4ever.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.krunk4ever.com\/blog\/wp-json\/wp\/v2\/comments?post=1352"}],"version-history":[{"count":0,"href":"https:\/\/www.krunk4ever.com\/blog\/wp-json\/wp\/v2\/posts\/1352\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.krunk4ever.com\/blog\/wp-json\/wp\/v2\/media?parent=1352"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.krunk4ever.com\/blog\/wp-json\/wp\/v2\/categories?post=1352"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.krunk4ever.com\/blog\/wp-json\/wp\/v2\/tags?post=1352"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}