SandersForPresident / SitesForBernie

SandersForPresident WordPress theme for campaign microsites
http://forberniesanders.com
Other
26 stars 9 forks source link

fix pubDate to return utc #57

Open johnkawakami opened 8 years ago

johnkawakami commented 8 years ago

Now uses post_date_gmt and reformats it from mysql to iso 8601.

This fixes a problem with sorting articles. The admin can more easily force the local article to the top of the page by setting the date after the latest remote story.

atticoos commented 8 years ago

It sounds like the main issue is that the local news is being pushed out by the remote news, yeah?

We've been thinking about breaking this into two columns rather than one over in https://github.com/SandersForPresident/SitesForBernie/pull/51

johnkawakami commented 8 years ago

The main issue for me was that I wanted to push the local story to the top. Changing the date didn't re-sort it correctly. I think it's because there's a timezone difference. (I didn't test this extensively.) The RSS feed coming from the campaign site is UTC. The MySQL date that WP returns doesn't have a time zone on it. strtodate converts the string to a date, but assumes the system's local timezone, which is EST.

It was also the modification date. I think it should be the publication date, which is what the author sets on each post.

johnkawakami commented 8 years ago

Sorry, i forgot the answer the question. Two columns would be fine, as well.