Google Reader Shared Items in WP RSS Widget
I just added a default RSS widget to one of my sidebars and noticed that the links weren’t functioning correctly. The source of the RSS feed is my google reader shared items and I think the format in which google sends the information is different than a normal RSS feed? I don’t know enough about them to be sure. All I know is that for some reason the link to the articles and the link to the sources of the articles are being concatenated together in the widget links.
Here’s a small 2-line fix I came up with if you’re familiar with php and the wordpress framework (version 2.5+).
In your {wp home}/wp-includes/widgets.php find the function wp_widget_rss_output(…). The first foreach() loop in the function should be foreach ($rss->items as $item ) { … Directly after the open curly brace, place these two lines of code:
$parts = explode(’http’,$item['link']);
$item['link'] = ‘http’.$parts[1];
Voila - that fixed the problem for me. All it does is explode the link string by the delimeter ‘http’ and rebuild the link using the first part. It’s not a very extensible solution though, so I would only use it if you just want to use a google reader shared items feed for the source of an RSS widget.




Add New Comment
Viewing 2 Comments
Thanks. Your comment is awaiting approval by a moderator.
Do you already have an account? Log in and claim this comment.
Do you already have an account? Log in and claim this comment.
Do you already have an account? Log in and claim this comment.
Add New Comment