Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Hello there i need help with the "Super RSS Reader". It works great but i need add function to get image thumbnail from RSS description.

foreach ($rss_items as $item){
            // Get the link
            $link = $item->get_link();
            while ( stristr($link, 'http') != $link ){ $link = substr($link, 1); }
            $link = esc_url(strip_tags($link));

            // Get the item title
            $title = esc_attr(strip_tags($item->get_title()));
            if ( empty($title) )
                $title = __('Untitled');

            // Get the date
            $date = $item->get_date('j F Y');

            // Get the description
            $desc = str_replace( array("\n", "\r"), ' ', esc_attr( strip_tags( @html_entity_decode( $item->get_description(), ENT_QUOTES, get_option('blog_charset') ) ) ) );

            if($strip_desc != 0){
                $desc = wp_html_excerpt( $desc, $strip_desc );
                if ( '[...]' == substr( $desc, -5 ) )
                    $desc = substr( $desc, 0, -5 ) . '[…]';
                elseif ( '[…]' != substr( $desc, -10 ) )
                    $desc .= ' […]';
            }
            $desc = esc_html( $desc );


            // Get the author
            $author = $item->get_author();
            if ( is_object($author) ) {
                $author = $author->get_name();
                $author = esc_html(strip_tags($author));
            }

            // Open links in new tab
            $newtab = ($open_newtab) ? ' target="_blank"' : '';

            echo "\n\n\t";

            // Display the feed items
            echo '<div class="srr-item ' . (($j%2 == 0) ? 'even' : 'odd') . '">';
            echo '<a href="' . $link . '"' . $newtab . ' title="Posted on ' . $date . '">' .$title . '</a>';
            if($show_date)      echo '<br/><em class="srr-date">' . $date . '</em>';
            if($show_author)    echo ' - <cite class="srr-author">' . $author . '</cite>';
            if($show_desc)      echo '<p class="srr-summary">' . $desc . '</p>';
            echo '</div>';
            // End display

            $j++;
        }
    }

Simply i need to add "get the image" part. i found some functions but i am not able implement them. I think many other which use the super rss reader will be happy to know how to add images from description and then display it on widgets. I also post question to creator but no answer so far.

Thank you for any advice.

share|improve this question

closed as off topic by Rarst May 27 '13 at 12:23

Questions on WordPress Development Stack Exchange are expected to relate to WordPress within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

    
The image is a part of the description tag in the xml and only usable via regex, not great and not performant. Also is this a way to change the content; not realy usefull for the authors of feeds. –  bueltge Oct 17 '12 at 12:36

Browse other questions tagged or ask your own question.