添加链接
link之家
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

I want the images in my RSS feed to be displayed so that if the feed is taken into Facebook my page will show the image with it.

This is my RSS feed:

<title>Title</title> <link>www.website.com</link> <guid>www.website.com/1/</guid> <description>Description</description> </item>

Do I add <image></image> and just stick the URL in? Or should I use <media:thumbnail> ?

I don't want the image to be the main content but instead have it show as thumbnail preview like when sharing a webpage on Facebook.

So if the RSS feed is taken into FB on my page it will show the image with it. soniccool Sep 21 '12 at 4:56 <media:thumbnail> is supposed to include the link to a thumbnail image for another media file, not being the media itself. But if you find it useful for your purposes it might work for you. jtheman Sep 21 '12 at 8:20 What about <media:thumbnail> I dont want the image to be the main content, i want the content to have a image with it like on facebook it would show the thumbnail as the image. soniccool Sep 21 '12 at 4:59
  • Convert the img tags to escaped HTML entities:

    <description>&lt;img src="http://example.com/path/to/image"&gt;</description>
    
  • Wrap the description content within a CDATA section:

    <description><![CDATA[<img src="http://example.com/path/to/image">]]></description>
    

    If you're thinking of using the <media:thumbnail> field, it's more for showcasing a thumbnail representation of an object enclosed in <media:content>.

    This element allows you publish a thumbnail image of your image or video. For Media RSS aware readers, this is a key feature, since readers are more likely to click on your media content if it has a nice shiny thumbnail. You’ll definitely need to give the URL attribute of your thumbnail image, which is all you basically need to do in order to include a thumbnail image.

    Use Media RSS - Webmonkey

    Your description can have all sorts of HTML normally seen on a webpage. Some readers may not parse things like video embeds though @son – random Sep 22 '12 at 2:31

    Thanks for contributing an answer to Stack Overflow!

    • Please be sure to answer the question. Provide details and share your research!

    But avoid

    • Asking for help, clarification, or responding to other answers.
    • Making statements based on opinion; back them up with references or personal experience.

    To learn more, see our tips on writing great answers.

    site design / logo © 2019 Stack Exchange Inc; user contributions licensed under cc by-sa 3.0 with attribution required. rev 2019.6.17.34003
  •