I uploaded a new, rewritten version of the KB Advanced RSS widget to the wordpress plugins repository today. Features:
- New options for trimming and formatting elements
- Better handling of the
pubdatefield - Easier to customize with your own code
Check out the updated instructions and FAQ over at WP.org (follow the download link). Although the old syntax will still work, I’ve made a few changes.
30 comments »
I’ve got another one for you. Thanks for the quick modification. Can you have a look at my eBay RSS feed at the bottom of this page and help me make heads or tails of the configuration? I have tried whatever I can figure to get the plugin to read specific fields in the array, but I’m quite confused now.
I’m attempting to add my listings with the Price, Title, Image, Current Bid, etc…to my widget. Maybe you have a clue???
Blog is the website I submitted in this comment, rss feed is at the bottom of my eBay store:
[link]
If you’re not sure how to display the title, then I’ll point you toward the documentation to start. As for the other fields, they’re more complex.
Usually I would just point you to the widget’s built-in debugger (see FAQ), but since your feed url has
?and&in it, that won’t work quite right. If you want to use the debugger (which would make this easier for you), pass your feed through FeedBurner first, then it will work.But in the meantime, here’s a couple pointers. If you look in the RSS feed, you’ll see information in fields like these:
Note that the field names have a
:in them. When WP parses the feed, it turns that into an array (and the names become lower case):The widget’s documentation explains how to display items from an array. The simplest way is to use something like this:
You would use the same method to display
g:image_link.My problem is that the feed I want to show appears with the oldest items first. So if I choose to to show 6, then I see the 6 oldest not the 6 newest. Can I easily list the feed from the bottom? Or could provide a ‘reverse order’ option?
John, starting at line 226 you should see this:
Insert one line so it looks like this:
If you use multiple instances of my widget on your blog, note that this will affect all of them. If that’s the case, use this slightly more complicated edit instead so that it affects only one instance of the widget (edit where indicated):
Had a problem getting the widget to pass validation XHTML 1.0 Strict when I updated to 2.0. Seems the widget title opens an li tag (with id kb-advanced-rss-#) and doesn’t close it.
Thanks for catching that. I mistakenly used
echo $this->after_widget;instead ofecho $after_widget;on line 444.Version 2.0.1 will be up on wp.org within a few minutes.
Just wanted to pass along a customization that I use:
I’ve had some issues with feeds that I Trust that I want to give fairly creative output to - i.e. I want to include html tags that actually get parsed, or javascript. A simple solution that I used was to update the item_cleanup function:
I moved the “some cleanup for security” section below the “apply opts, if given” section, and wrapped it in:
if (!isset($bypasssecurity)) {
}
So, now if i have a feed that I TRUST, I can just [opts:bypasssecurity].
That’s a good idea–I’ll try to remember to integrate that into the next update.
Hi
Great feed reader but is it possible to have the feeds open in a new window / tab (or maybe as a flyout)instead of the same window?
Thanks in advance.
Nick
Thanks Adam. I now have the items coming out with the newest at the top. Could you consider adding a Reverse option to the widget configuration in a future release.
Also have a suggestion for any troubleshooting site. Many feed readers give the url of a feed as
feed://...If you paste this into the widget it does not work. You have to change it tohttp://...Thanks again
John
@Nick: Yes, just write the necessary HTML (or javascript) into the widget options. That’s sort of the point–DIY. :) The easiest way is to set the
target="_blank"attribute in the<a>tag. Further reading.@John: You’re correct about the
feed://thing. That’s thrown people off before. I need to remember to have the widget automatically strip that off.As for an option to reverse the order… Maybe. That’s a rare request; introducing too many standard options bloats the code, and I’m not sure enough people would use it to warrant doing it. We’ll see.
Hi Adam
Thanks for your quick reply I am totally new to this I have had a look at your reply and the linked page tried some editing bit am unable to get it to work any chance you could perhaps give me another hint?
Cheers
Nick
In general,
So maybe
or whatever you like. Note, though, that many people configure their browsers to ignore the
_blankattribute. And many of those who don’t wish that they knew how–this sort of thing annoys lots of folks.I’m getting the “feed is probably down” error, but that’s because the feed is empty (it’s a weather warnings feed, and often there’s no warnings).
Is there a way to change the error text shown? I know the feed works, so I’d rather it said something like “No warnings at this time” instead.
PS posting here as comments on the previous post are closed.
Dan, check out the discussion starting with this comment. It’s probably worth your while to read the entire conversation (around a dozen comments) before fiddling with the code, though.
Cheers, that works perfectly. Maybe add that tip to the FAQ?
Good idea, I’ll try to remember on my next update.
I spoke too soon — today warnings have been issued, but the widget didn’t appear. Removing the bit of code added:
if ( !is_array( $rss->items ) )
return;
Restored the widget. I put it in and took it out again to confirm.
Sorry for the delay, I’m swamped with my work right now. Two thoughts:
First, where exactly did you paste that code? If it’s in the wrong place, it will kill the widget.
Second, the widget checks the feed only once every hour or so. If the warning was issued, but you waited less than an hour to check your site, don’t be surprised if it takes an hour for it to show up on your site.
I pasted the code into Notepad2 and did a search for:
echo $before_widget;Sorry, typo. Should be:
I pasted the code into Notepad2 and did a search for:
echo $before_widget;Then pasted the suggested code right before that.
The warning had been out for around nine hours at the time (I did do a check with the tool built into the widget too).
Dan: Get version 2.1. I just released it today. There’s now a checkbox that will solve all your worries.
Thanks!
Hi, ive a problem, when i show my (rss title) it convert the ‘ or ” with ? why this??
hi, i’m trying to make a tipoftheday sidebar. i am posting to a specific category and the posts are short. is there a way to rss the whole post and not jsut the title with oyur plugin?
many thanks
Jack: Yes, read the documentation.
Alessandro: I just noticed the comment. If you’re still wrestling with it, let me know.
I don’t know what I’m doing wrong, but I still can’t get the RSS Feed Widget to work. If I go to the actual feed URL in Firefox or something, it shows a whole bunch of stuff. It’s correct in other words, but the KB RSS Widget only shows one item.
I’m trying to use this plugin to show my gallery updates in my sidebar (new albums, new pics, etc.), but it doesn’t seem to update. The feed itself is working fine, I can subscribe in Firefox and everything works, but nothing shows up in the widget but one item.
Standard response:
(1) Check the FAQ, particularly the “how do I debug the feed” stuff. (It’s possible that WP sees only one item in the feed.)
(2) I can’t tell you anything more specific without seeing the feed URL. But first look through the faq.
Right, I figured I’d get referred to documentation, which is fine. I just thought I’d ask anyway. I can provide you the feed URL if you’d like.
I cant seem to figure out how to make more than 10 entries from the atom feed to appear in the widget output. I’ve selected : Number of items to display: 42 (there are 42 entries on the category) and only 10 show up.
Leave a comment