Images in RSS feed

后端 未结 6 1308
北海茫月
北海茫月 2020-12-30 22:23

Whenever I see images in an RSS feed, they are embedded in CDATA, rather than surrounded by tags.

In my feed, I would like the images to show up without doing that.<

6条回答
  •  死守一世寂寞
    2020-12-30 22:55

    You can use the media:content element (spec) within item.

    Make sure you declare the MRSS (Media RSS) namespace (the xmlns:media attribute, below) for this element, if it is not declared for the whole RSS feed, as it won't validate otherwise. (E.g., out-of-the-box WordPress.)

        
    

    This may or may not display as you'd like; you'd have to experiment. Embedding in content is in that way simpler, though this route helps with things like MailChimp integration (h/t this answer) or other custom solutions.

    An example implementation for WordPress is in my answer here.

提交回复
热议问题