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.