Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #12913

    I’ve searched this topic, but as of yet haven’t found a solution that works for me. I’d like to make it so that photos will appear in the RSS feed from my flashlight blog. I’ve set the features inside wordpress as one would expect, but it hasn’t worked for me. I’ve also waited for 24 hours, and added new posts, but to no avail. I also tried adding this script to the bottom of the features.php script as referenced in a previous post from Dude, but it hasn’t worked for me.

    // THIS INCLUDES THE THUMBNAIL IN OUR RSS FEED

    add_filter( ‘the_excerpt_rss’, ‘inoplugs_insertThumbnailRSS’ );

    add_filter( ‘the_content_feed’, ‘inoplugs_insertThumbnailRSS’ );

    function inoplugs_insertThumbnailRSS( $content ) {

    global $post;

    $slides = avia_post_meta($post->post_id, ‘slideshow’);

    if ($slides){

    $postimage = avia_image_by_id($slides[0],’thumbnail’);

    $content = ‘<div>’ . $postimage . ‘</div>’ . $content;

    return $content;

    }

    }

    Any other suggestions? Is it a matter of configuring the reader to see the images, or am I missing something?

    #77143

    Hey,

    add following code to functions.php:

    // THIS INCLUDES THE THUMBNAIL IN OUR RSS FEED
    add_filter( 'the_excerpt_rss', 'inoplugs_insertThumbnailRSS' );
    add_filter( 'the_content_feed', 'inoplugs_insertThumbnailRSS' );
    function inoplugs_insertThumbnailRSS( $content ) {

    global $post;
    $id = avia_post_meta($post->post_id, 'gallery_image');
    $size = "portfolio";
    $returnvalue = 'url';
    global $avia_config;

    if(!$id)
    {
    $attachment_holder = avia_get_post_by_title( "avia_smart-default-gallery");
    }
    else
    {
    $attachment_holder = avia_get_post_by_title( "avia_smart-gallery-of-post-".$id);
    }

    if(empty($attachment_holder['ID'])) return;

    $attachments = get_children(array('post_parent' => $attachment_holder['ID'],
    'post_status' => 'inherit',
    'post_type' => 'attachment',
    'post_mime_type' => 'image',
    'order' => 'ASC',
    'orderby' => 'menu_order ID'));

    if (!empty($attachments)){
    foreach($attachments as $key => $attachment)
    {
    $image_url_array[] = avia_image_by_id($attachment->ID, $avia_config['imgSize'][$size], $returnvalue);
    }
    }

    $postimage = "";

    if (!empty($image_url_array)){
    foreach($image_url_array as $url)
    {
    $postimage .= "<img src='$url' alt='feed image' title='feed image' />";
    }
    }

    $content = '<div>' . $postimage . '</div>' . $content;

    return $content;
    }

    #77144

    That did it! Thanks for the help :)

    #77145

    Glad that worked for you :)

    Regards,

    Devin

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

The topic ‘Show images in RSS Feed’ is closed to new replies.