| User | Post |
|---|
2:47 pm November 10, 2009 | Chris Ullyott
| | Fullerton, CA | | | Member | posts 66 |
| | Yayuh! We're developing an iPhone app, but the app requires that the images in our RSS feed be enclosures, including the <enclosure> tag. Any plugin ideas to convert RSS image src links to enclosures? Thanks a bunch, Chris | |
|
6:40 pm November 10, 2009 | Daniel Bachhuber
| | | | | Admin | posts 102 |
| | Excellent question, Chris! Thanks for posting it. I think the ideal approach would be to build a small custom plugin that allows you to add either images in the post or images in a custom field as enclosures to an RSS feed. An additional option would be that it generates its own custom RSS feed so that you don't necessarily have to include the images as enclosures in the primary feed. I'd go the route of building a plugin versus customizing the RSS templates in WordPress because the RSS templates are a part of the core files and will be overwritten every time you upgrade. I suspect your next question is: how do I build a plugin? Thanks to Miles, you won't have to start from scratch. There's another plugin in the directory that you can use as a foundation. If I were you, I'd download that and then watch this video about building your first plugin. I suspect you'll only need to do a few modifications to get it where you need it. Feel free to ask any specific questions you have about this process. | |
|
9:13 pm November 10, 2009 | Chris Ullyott
| | Fullerton, CA | | | Member | posts 66 |
| | We'd be interested making this convert the post images themselves into enclosures if possible, so that our writers do not have to go through an extra step. We'd have to keep them in the original feed as well. Is this possible with a plugin? | |
|
11:32 pm November 10, 2009 | Daniel Bachhuber
| | | | | Admin | posts 102 |
| | It is certainly possible with a plugin. The approach I would take would be to search the post content for the first <img> tag, and then put the source value of that as the enclosure. | |
|
7:00 pm November 12, 2009 | Chris Ullyott
| | Fullerton, CA | | | Member | posts 66 |
| |
2:13 pm November 13, 2009 | Chris Ullyott
| | Fullerton, CA | | | Member | posts 66 |
| | The approach I would take would be to search the post content for the first <img> tag, and then put the source value of that as the enclosure.
Do you mean that this is what the plugin would do? I am a little lost. | |
|
9:17 pm November 13, 2009 | Chris Ullyott
| | Fullerton, CA | | | Member | posts 66 |
| | Hmm, I'll have to look into this further when I have more time. However—the original plugin recommended by Daniel, called WP RSS Images by Alain Gonzalez did the trick for us. What it does is, with every post with a picture, it kind of duplicates that picture but adds it into the post as an enclosure. So, in the feed, you see an image file, but the picture does not display. We needed this so our iPhone app could pull the image files (it could not deal with the normal <img src> tags. | |
|