Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #7164

    Hello

    Could you tell me how to make images (from image galleries) appear in my rss ? In reader text appears but pictures shows up only if I had them in the post.

    Thanks again for your support !

    thibautvoisin.com

    #56947

    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;
    }

    #56948

    Maybe, I have a problem,

    Images and texts have disappeared of my RSS. Only posts titles shows up now

    Do you have an idea ?

    #56949

    I changed the code. Please try it again.

    #56950

    Yeeees it works now !

    Is it possible to show full size images instead of thumbnails in reader ?

    Thanks for your help

    #56951

    Yes,

    replace:

    $size = “portfolio”;

    with:

    $size = “fullsize”;

    #56952

    Nice, thanks very much.

    #56953

    Glad that I could help you :)

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

The topic ‘Make images of galleries appear in RSS readers’ is closed to new replies.