-
AuthorPosts
-
November 12, 2020 at 8:29 pm #8371Ed NativeParticipant
I found your faq here:
Below is the order in which the thumbnail image will be searched.
From the feed item’s <enclosure> tag -> thumbnail URL.
From the feed item’s <enclosure> tag -> URL.
The first image from the feed item’s content.
From the feed item’s <image> tag if present.My problem is that the thumbnail is located in the such blocks:
<img class="ytp-thumbnail-image" src="..." width="690" height="388">
Is it possible to change the file in your plugin directly?
November 12, 2020 at 8:41 pm #8372Aakash ChakravarthyKeymasterHi,
If image is not found in the first 3 locations then the image will be picked from the tag present in the description.
Please do try the RSS feed and see if you are getting the expected image.
Thanks,
AakashNovember 12, 2020 at 8:44 pm #8373Ed NativeParticipantthere is emoji in the first line of my post. I wouldn’t like to use it. Can I exclude emoji from being taken as a thumbnail?
November 12, 2020 at 8:51 pm #8374Ed NativeParticipantplease, check my rss https://natives.chat/c/korean/26.rss
I’m ready to change the code of the plugin and update it manuallyNovember 12, 2020 at 8:52 pm #8375Aakash ChakravarthyKeymasterOk.. you have to edit the code a bit. I haven’t tested, but you can give a try.
Replace lines 275, 276 and 277 like below in
https://plugins.trac.wordpress.org/browser/super-rss-reader/trunk/includes/feed.php#L275275 if( !empty( $urls ) && isset( $urls[1] ) ){ 276 return $urls[1]; 277 }
Here you can change 1 to n-1th image you would like to pick. i.e if 2nd image then 1. if 3rd then 2.
Please disable the plugin before making any modification.
Thanks,
AakashNovember 12, 2020 at 9:10 pm #8376Ed NativeParticipantGot an error trying to activate after the change:
Plugin could not be activated because it triggered a fatal error.// Outer wrap end $html .= '</div></div>' ; if( !is_wp_error( $feed ) ) $feed->__destruct(); /* unset( $feed ); } */ if( !empty( $urls ) && isset( $urls[1] ) ){ return $urls[1]; } $html = '<div class="srr-main">' . $html . '</div>'; return $html; } function get_thumbnail_url( $item ){
November 12, 2020 at 9:29 pm #8377Aakash ChakravarthyKeymasterYou’ve made the change incorrectly.
Please copy full file from here – https://pastebin.com/vv0BcFD2November 12, 2020 at 9:47 pm #8380Ed NativeParticipantMy answers are not submitted.
So your help was successful. Thank you.
But I have 2 problems now:
1) grid is not working
2) unnecessary code is added: https://prnt.sc/vi3x7v
November 12, 2020 at 9:55 pm #8381Ed NativeParticipantmy shortcode
[srr_feed urls="https://natives.chat/c/korean/26.rss" count="9" show_desc="1" show_thumb="1" strip_desc="30" rich_desc="0" add_nofollow="1" open_newtab="1" thumbnail_position="cover" read_more="0" thumbnail_size="350px" color_style="twitter" display_type="grid" grid_columns="3"]
November 12, 2020 at 10:30 pm #8382Ed NativeParticipantAny ideas how to solve it?
November 12, 2020 at 11:18 pm #8384Ed NativeParticipantI have a pro version. I see that you gave me a code of a free version
November 12, 2020 at 11:28 pm #8385Ed NativeParticipantI’ve change the code in the pro version and there is no problem with grid template.
The only thing is this:
image1600×1067 415 KB that is inserted in the beginning of the description
https://prnt.sc/vi3x7vNovember 12, 2020 at 11:33 pm #8386Ed NativeParticipantthis info is in this part:
<span class=”informations”>960×639 87.8 KB</span>how can we exclude these blocks?
November 13, 2020 at 12:01 am #8387Aakash ChakravarthyKeymasterHi @Ed,
Sorry I was not aware that you used the PRO version.
Good that you were able to change the 3 lines yourself.
Regarding the additional text, that is coming from the RSS feed.
You can use CSS to hide it.Can you please share me the page where it is used ?
I’ll suggest CSS to hide them.
November 13, 2020 at 12:06 am #8388Ed NativeParticipantCan’t use css, as in browser it is shown in a plain text like
‘<p>image1226×1233 363 KB… text </p>’ -
AuthorPosts
- You must be logged in to reply to this topic.