genuskbl
Forum Replies Created
-
@er_maqui
Indeed, but my solution was for only title and thumbnails. so for those who likes to show only title and thumbnail it they must do that because the plugin will not print the thumb otherwise.i haven’t tested your solution but for one part it, you still need to echo $thumb on the output.
Salam,
i run into this problem just now and i noticed that the above code is missing another part where you need to add $thumb in output.
so for me this is the working version.
1. make sure your feed has enclosure check at
yourblog.com/category/feed
1.i if your feed doesn’t have enclosure please add this code to your theme’s function.php fileadd_action('rss2_item', function(){ global $post; $output = ''; $thumbnail_ID = get_post_thumbnail_id( $post->ID ); $thumbnail = wp_get_attachment_image_src($thumbnail_ID, 'thumbnail'); $mime = get_post_mime_type($thumbnail_ID); $output = '<enclosure url="'.$thumbnail[0].'" type="'.$mime.'"/>'; echo $output; });2. go into the Plugin Editor and edit the file super-rss-reader/super-rss-reader.php replace this code for me its on 325th line.
// Get thumbnail if present @since v2.2 $thumb = ''; if ($show_thumb == 1 && $enclosure = $item->get_enclosure()){ $thumburl = $enclosure->get_thumbnail(); if(!empty($thumburl)) $thumb = '<img src="' . $thumburl . '" alt="' . $title . '" class="srr-thumb" align="left"/>'; }with this
// Get thumbnail if present @since v2.2 if($show_thumb == 1) { $enclosure = $item->get_enclosure(); // if we have a proper XML tag for our rss-feed image if($enclosure->get_link()) { $thumburl = $enclosure->get_link(); // else we will search a <img> tag in our description } else{ $thumburl = "url to temp image.png";//$item->get_thumbnail(); } // if, at last, we have filled our $thumburl if(!empty($thumburl)) { $thumb = '<img src="' . $thumburl . '" alt="' . $title . '" class="srr-thumb" style="float: right !important;margin: 0 0 0 10px!important; border: 1px solid;30px !important"/>'; } } // end if show tabsin above code there “url to temp image.png don’t forget to replace it with your own temp image in case the thumbnail is not available.
and also you can change the style style=”float: right !important;margin: 0 0 0 10px!important; border: 1px solid;30px !important” to whatever you like i wanted the image to show on the right side of title.3. on the same file find // Display the feed items
original codeecho '<div class="srr-title"><a title="Posted on ' . $date . '">' . $title . '</a></div>';i wanted the image to show on the right side of my feed title.
so i changed toecho '<div class="srr-title"><a title="Posted on ' . $date . '">'.$thumb. $title . '</a></div>';see above i added $thumb before title
that’s all hope it helps some one.
Best, From Afghanistan.