Forum Replies Created
-
AuthorPosts
-
Jeff KimmelParticipant
Aakssh,
Got it working, thanks for all you help!
Jeff
Jeff KimmelParticipantAakash,
Thanks for the feedback. I created a little program that calls the feed & saves the xml file. In testing, it looks like the RSS is using the cached version of the file (I removed the file on the server & the feed was still working). Is there any way to set the reader to not cache?
Terence,
We’re a MS shop and the program I wrote is in c#, would you like the code snippet that I’m using? It might help your issue if you can get the feed in an XML file.
Thanks,
Jeff
Jeff KimmelParticipantAakash,
I added the code snippet & copy and pasted what you showed & it still isn’t working. Like I said before, the RSS feed that is received has blank lines at the beginning & it didn’t validate. I’m not sure where to go from here.
Jeff
Jeff KimmelParticipantAakash,
I searched the code on our site & tried to add what you mentioned into Utilities.php in ‘plugins\super-rss-reader\includes\Utilities.php’. It’s a static class so I changed a couple things but it didn’t help the issue. Where does this need to go? Below are the contents of Utilities.php for review.
Thanks,
Jeff
public static function init(){
add_filter( ‘the_excerpt_rss’, array( __CLASS__, ‘insert_featured_image_rss_feed’ ) );
add_filter( ‘the_content_feed’, array( __CLASS__, ‘insert_featured_image_rss_feed’ ) );
add_filter( ‘wp_feed_options’, ‘srr_set_user_agent’, 10, 2 );
}public static function insert_featured_image_rss_feed( $content ){
global $post;
preg_match_all( ‘~<img.*?src=[“\’]+(.*?)[“\’]+~’, $content, $image_urls );
if( empty( $image_urls[1] ) && has_post_thumbnail( $post->ID ) ) {
$content = ‘<p>’ . get_the_post_thumbnail( $post->ID ) . ‘</p>’ . $content;
}return $content;
}
public static function srr_set_user_agent( &$feed, $url ) {
$feed->set_useragent(‘Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36’);
}
Jeff KimmelParticipantAakash,
Thanks for the reply but where do I copy that to? I’m using the wordpress plug in & I have a bunch of files i could put it in but I’m not sure where it should go.
Thanks,
Jeff
-
AuthorPosts