• I’ve finally got WP to install and mesh with my website template like butter. Totally awesome.

    I am currently publishing the RSS via a php script to my homepage. So everytime the blog is updated, the RSS feed is updated on my homepage with the relevant link.

    Here is the issue, WP is following the proper RSS 2.0 spec and using that really strange date and time format with the +0000 at the end of it. This looks horribly tacky on the homepage.

    I tried going into the wp-rss2.php file in my home directory to see if I could change something, but it says that file is deprecated. I have NO idea what file is generating the feed or how to change the time/date format.

    Ideally I’d have the RSS format as: F jS, Y

    Can anyone point me to the right file? 🙂

Viewing 5 replies - 1 through 5 (of 5 total)
  • During import of your RSS feed from your blog, you should use something like PHP’s date function plus PHP’s strtotime() function to format the date.

    Something like:
    date(‘Y-m-d’, strtotime($rssTime))

    The problem is not WordPress’s RSS feed, it is the script that is parsing and displaying the RSS to your homepage, as the WordPress RSS script builds the feed to the RSS specification. If you were to change this date format, than many RSS readers may reject the feed when your users try to import it.

    Sorry, set it up like this:

    date(‘F jS, Y’, strtotime($rssTime));

    Where $rssTime is the variable that you actually have with the time from the RSS feed in it.

    Thread Starter bemaitea

    (@bemaitea)

    Thanks for the response wprelief!

    I’ve been racking my mind over this for many hours now and still can’t quite get it.

    It seems as though the code I’m using is simply parsing the data from the RSS XML and echoing it, so it isn’t re-formatting anything. Meaning that depending on how the source RSS has the date published is how the date is published on feed.

    For example, my code will parse the WP RSS feed and publish a date in this formate: Tue, 06 July 2010 1:01:01 +0000, but for Twitter, it will pasre the Twitter RSS feed an publish the date like this: July 5th, 2010 1:01. Looking at both the WP and Twitter RSS source codes, it is clear that the feed script I’m using is simply echoing their respective values.

    Is there anyway to make the php reinterpret the pubDate in my desired format??

    Code is as follows:

    [Code moderated as per the Forum Rules. Please use the pastebin]

    Thread Starter bemaitea

    (@bemaitea)

    Using the date code you gave before: http://wordpress.pastebin.com/RsXhKLYV

    What I would do is just replace the code where it outputs the date, to format the date the way you want it.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Customize rss feed’ is closed to new replies.