Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #502

    Hi Kriesi,

    Using your great theme and having fun customising it for a commercial news site.

    I am trying to set up feeds to another site and although I can get seperate feeds for each category, no images show in the feed. I am only using the ‘Featured image’ from WP 3.0, so how can I get images into the feed?

    Is this a theme mod, or WordPress 3.0 mod?

    #31689

    Hey!

    Adding images to RSS feeds is easiest with a plugin such as this one: http://wordpress.org/extend/plugins/rss-image-widget/

    Are you using a RSS widget to get the content on the other site?

    Best regards,

    James

    #31690

    No. I want images to appear in the actual RSS feed.

    I know there’s a plugin for adding thumbnails from an image attachment into the feed, but when using only ‘Featured Images’ with this theme, no images show.

    I added a few lines of code into functions.php:

    // THIS INCLUDES THE THUMBNAIL IN OUR RSS FEED
    function insertThumbnailRSS($content) {
    global $post;
    if ( has_post_thumbnail( $post->ID ) ){
    $content = '' . get_the_post_thumbnail( $post->ID, 'thumbnail' ) . '' . $content;
    }
    return $content;
    }

    add_filter('the_excerpt_rss', 'insertThumbnailRSS');
    add_filter('the_content_feed', 'insertThumbnailRSS');

    …but that only adds a tiny thumbnail into the main feed and doesn’t add anything into the category feeds domain.com/category/feed.

    i’m stuck…

    #31691

    If you’re comfortable adding PHP functions then forget the plugin. I’ve used this code before for a client and this worked (for categories as well):

    function rss_post_thumbnail($content) {
    global $post;
    if(has_post_thumbnail($post->ID)) {
    $content = '<p>' . get_the_post_thumbnail($post->ID) .'</p>' . get_the_content();
    }
    return $content;
    }
    add_filter('the_excerpt_rss', 'rss_post_thumbnail');
    add_filter('the_content_feed', 'rss_post_thumbnail');

    Regarding the image size, your code specified the ‘thumbnail’ size which is usually very small. What size do you want the images to be?

    #31692

    Hi James,

    I altered the code and changed the thumbnail size in ‘Settings’ –> ‘Media’ in wordpress admin. All (new) images are now at desired size. As newscast uses Tim Thumb across the site for thumbnails and not the WordPress thumbnail settings (150x150px), it works a charm.

    #31693

    Hey,

    Awesome, I’m glad you sorted this out.

    If you have any other questions, let me know.

    Cheers,

    James

    #31694

    HI everyone, we have the same problem with RSS Image Feed.

    I wish to have the feeds like this:

    http://notiziefresche.info/feed/ and like this http://notiziefresche.info/feed/rss/

    but we have this, now:

    http://www.mexplora.com/viajes-mexico/feed/ and this http://www.mexplora.com/viajes-mexico/feed/rss/

    We tried with your solution, and now we are in this solution on functions.php of theme Newscast:

    function rss_post_thumbnail($content) {
    global $post;
    if(has_post_thumbnail($post->ID)) {
    $content = '<p>' . get_the_post_thumbnail($post->ID) .'</p>' . get_the_content();
    }
    return $content;
    }
    add_filter('the_excerpt_rss', 'rss_post_thumbnail');
    add_filter('the_content_feed', 'rss_post_thumbnail');

    So, who can help us? how we can to do for to go in goal?

    nice day ;)

    #31695

    we tried also this code in functions.php but nothing :

    function add_image_custom( $content ) {

    remove_filter('the_content', 'add_image_RSS');
    add_filter('the_content', 'add_image_custom');

    global $post, $id;
    $blog_key = substr( md5( get_bloginfo('url') ), 0, 16 );
    if ( ! is_feed() ) return $content;

    // Get the "image" from custom field
    $image = get_post_meta($post->ID, '_wp_attached_file', $single = true);
    $image_width = '104';

    // If there's an image, display the image with the content
    if($image !== '') {
    $image = '<p style="float:right; margin:0 0 10px 15px; width:'.$image_width.'px;">
    <img src="http://www.mexplora.com/viajes-mexico/wp-content/uploads/'.$image.'" />
    </p>' ;
    echo $image;
    return $content;
    }

    // If there's not an image, just display the content
    else {
    $content = $content;
    return $content;
    }
    }

    #31696

    Hi!

    What happens if you use the code I previously posted?

    Regards,

    James

Viewing 9 posts - 1 through 9 (of 9 total)

The topic ‘No RSS feed images’ is closed to new replies.