WP RSS Images – Wordpress Plugin

Wordpress plugin that allows to use the first attached image of your post on your RSS.  You can select the size of the images on the admin panel.

Installation

1. Upload ‘wp rss image’ folder to the `/wp-content/plugins/` directory.
2. Activate the plugin through the ‘Plugins’ menu in WordPress.
3. Go to Settings/WP RSS Image and select the image size (Thumbnail, Medium, Full) and the feed (rss, rss2).

Settings

Feed Examples

RSS  http://web-argument.com/feed/rss/
RSS 2 http://web-argument.com/feed/

Dowload
wp-rss-image v1.00 – From wordpress plugin directory

November 9th, 2008  | Tags: , , , , , ,
  1. 10-nice
    February 17th, 2010 at 13:45
    Reply | Quote | #1

    Hi,

    I notice that your plugin only return the first attached picture for a post, but it should be better if it returns the post’s attached thumbnail if exists.

    here is the update of your rss_image_url() function :

    function rss_image_url($default_size = ‘medium’) {
    global $post;
    if(has_post_thumbnail()) :
    $img = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ) );
    else:
    $attachments = get_children( array(’post_parent’ => $post->ID, ‘post_type’ => ‘attachment’, ‘post_mime_type’ => ‘image’, ‘order’ => ‘ASC’, ‘numberposts’ => 1) );
    if($attachments == true) :
    foreach($attachments as $id => $attachment) :
    $img = wp_get_attachment_image_src($id, $default_size);
    endforeach;
    endif;
    endif;
    return $img[0];
    }

    Best regards, and thanks a lot for your plugin :)

  2. February 16th, 2010 at 16:08
    Reply | Quote | #2

    Does this plugin work with Wordpress 2.7 – 2.9.2 ? Couldn’t get a confirmation on that at http://wordpress.org

  3. Leshell
    February 12th, 2010 at 22:51
    Reply | Quote | #3

    This does not work for me. Can you help determine what’s wrong?

    Thanks.

    -Leshell

  4. February 1st, 2010 at 04:19
    Reply | Quote | #4

    Hi, great little plugin. Thanks. I too would like to display the image instead of as an attachment. I think Jacob Cass suggestion to have it grab a custom field would be great. Someone else posted that they needed to easily change the image. Having the option to grab the contents of a custom field would also fix someone else’s request to post the last image instead of the first. What do you think?

  5. Michael Kröll
    January 23rd, 2010 at 20:30
    Reply | Quote | #5

    The current version does HTTP requests for every found attachment image to get the filesize which makes the loading of feeds *really* slow if you have some of them. This patch fixes that:

    Index: wp-rss-images.php-noextrahttprequestsfix.diff
    ===================================================================
    — wp-rss-images.php-noextrahttprequestsfix.diff (revision 0)
    +++ wp-rss-images.php-noextrahttprequestsfix.diff (revision 0)
    @@ -0,0 +1,37 @@
    +— wp-rss-images.php.orig 2010-01-23 19:33:28.000000000 +0100
    ++++ wp-rss-images.php 2010-01-23 21:22:54.000000000 +0100
    +@@ -25,13 +25,11 @@
    + else $image_url = rss_image_url(’medium’);
    +
    + if ($image_url != ”) :
    +-
    +-$filename = $image_url;
    +-$ary_header = get_headers($filename, 1);
    +-
    +-$filesize = $ary_header['Content-Length'];
    +-
    +-echo “”;
    ++ $uploads = wp_upload_dir();
    ++ $url = parse_url($image_url);
    ++ $path = $uploads['basedir'] . preg_replace(’/.*uploads(.*)/’, ‘${1}’, $url['path']);
    ++ echo “”;
    ++ echo “”;
    + endif;
    + }
    +
    +@@ -39,11 +37,10 @@
    +
    + function rss_image_url($default_size = ‘medium’) {
    + global $post;
    +- $attachments = get_children( array(’post_parent’ => $post->ID, ‘post_type’ => ‘attachment’, ‘post_mime_type’ => ‘image’, ‘order’ => ‘ASC’, ‘numberposts’ => 1) );
    +- if($attachments == true) :
    +- foreach($attachments as $id => $attachment) :
    +- $img = wp_get_attachment_image_src($id, $default_size);
    +- endforeach;
    ++ $attachments = get_children( array(’post_parent’ => $post->ID, ‘post_type’ => ‘attachment’, ‘post_mime_type’ => ‘image’, ‘order’ => ‘menu_item’, ‘numberposts’ => 1) );
    ++ if($attachments !== false) :
    ++ $attachement = current($attachments);
    ++ $img = wp_get_attachment_image_src($attachement->ID, $default_size);
    + endif;
    + return $img[0];
    + }

  6. Daniel DiGriz
    January 8th, 2010 at 19:33
    Reply | Quote | #6

    Works. But seems to limit the images to 5? When I turn it off, I get none. When I turn it on, I get 5.

  7. November 29th, 2009 at 00:26
    Reply | Quote | #7

    @Franklin
    Ah yes the clear cache should always be checked before any comments. Looks great!

  8. November 28th, 2009 at 23:21
    Reply | Quote | #8

    Hi Alain. Thanks for the puggin. I just put up a new 2.8 blog. No errors but no changes to my rss. Any upgrade work arounds or i just need be patient for the update?
    Thanks
    Franklin

  9. Alain
    November 26th, 2009 at 15:33
    Reply | Quote | #9

    @Aaron
    get_header is a wordpress function. Uninstall others plugins to see any interaction.

  10. Aaron
    November 26th, 2009 at 07:07

    I am having an issue. When I try to use this plugin, I get the following error when I try to get the RSS feed:

    Fatal error: Call to undefined function: get_headers() in /wp-content/plugins/wp-rss-images/wp-rss-images.php on line 30

    Is there something I’m doing wrong?

  11. Alain
    November 21st, 2009 at 18:18

    @Stephane
    The plugin uses the first attached image you can edit the code to use the last one.

    Thanks.

  12. Stephane
    October 19th, 2009 at 14:37

    Hi,

    Thanks for the plugin! It’s been very useful…

    Is there a way we can change the image in the feed once a post has been published? Once in while we have to change the image attached to a post, but th original image stays in the RSS feed…

    Thanks,

  13. September 2nd, 2009 at 02:51

    hi
    i want a plugin that import images from skydrive(or any rss refrence) in a post as a album
    can you help me that where can i find that?
    please
    sory for bad english

  14. June 25th, 2009 at 14:00

    I’m interested in this WP RSS Images plugin, but I’m not sure that it does exactly what I want it to do.

    I aggregate the feed from my Distractions, reflections blog over to Friendfeed. I’ve noticed that a blog entry with photos in it doesn’t produce a photo in Friendfeed (e.g. see this Friendfeed entry picking up a blog post.

    I would like the effect described as Using Images to Make Your RSS Feeds Pop, which seems to use an [image] [/image] — read those as angle brackets! — rather than an attachment in the RSS as you do.

    I suspect that your plugin might be adapted to do that … but then, I’m not a developer!

  15. May 29th, 2009 at 14:37

    Same here. I’m using WP 2.71, and no settings. Should I change sumthin’ in the code?

  16. April 26th, 2009 at 00:10

    I couldn’t get it to work either. I’m using WordPress 2.7.1

  17. Dave
    April 14th, 2009 at 21:21

    It activates in wp 2.0.9 but I cannot find the control area. There’s no such thing as Settings/WP RSS Image. There’s an options tab, but nothing about WP RSS Image. Help please.

  18. deynira
    April 1st, 2009 at 19:12

    I could not get it to work on wp 2.7.1 .. after i installed it, it broke my link feed. Does it work on wp 2.7.1

  19. March 23rd, 2009 at 17:31

    @Gordon Franke

    i have add also atom support.

    please contact me.

  20. March 23rd, 2009 at 15:22

    hello i have patched the plugin:

    1. add correct Content-Type
    2. remove foreach use simple current
    3. remove php warning
    4. format code

    21d20
    < $image_size = get_option(’rss_image_size_op’);
    23,24c22,23
    < if (isset($image_size)) $image_url = rss_image_url($image_size);
    $image_size = get_option(’rss_image_size_op’);
    > if (isset($image_size)) $image_url = rss_image_url($image_size);
    26,28c25,30
    < if ($image_url !== false) :
    < $filename = $image_url;
    else $image_url = rss_image_url(’medium’);
    >
    > if ($image_url != ”) :
    >
    > $filename = $image_url;
    > $ary_header = get_headers($filename, 1);
    30,31c32
    < $filesize = $ary_header['Content-Length'];
    $filesize = $ary_header['Content-Length'];
    33,34c34,35
    < echo “”;
    echo “”;
    > endif;
    40,41c41
    < global $post;
    global $post;
    43,48c43,46
    <
    < if($attachments !== false) :
    < $attachment = current($attachments);
    ID, $default_size);
    <
    if($attachments == true) :
    > foreach($attachments as $id => $attachment) :
    > $img = wp_get_attachment_image_src($id, $default_size);
    > endforeach;
    50,51c48
    <
    return $img[0];

  21. January 10th, 2009 at 16:56

    Hi, Nice plug in, works great, here it comes, but is there any way to have the image appear in the rss feed ala engadget.com?

    Thanks,

    Adam

  22. December 27th, 2008 at 22:53

    I see that this includes the image as an attachment, but doesn’t actually display the image in the feed. Is this the way the plugin is supposed to work? I want something that will actually show the image along with the text. Please advise.

  23. December 10th, 2008 at 21:37

    Thanks for this great plugin. My wifi photo frame needs the Media RSS Module to load images. So I patched your plugin to support it:

    http://www.vdberg.org/wp-rss-images.mrss.patch
    http://www.vdberg.org/wp-rss-images.txt

  24. November 26th, 2008 at 00:19

    Would this display an image that was used in a custom field?

  25. November 10th, 2008 at 18:29

    hi. Thanks for plugin

    perfect.

    Regards

  26. Alex
    November 9th, 2008 at 03:50

    This sure comes in handy. I’ll give it a try and will post results later.

    Thanks a lot.

TOP