我已经安装了 Simplepie 来将 blog.domain.com 中的博客文章联合到 domain.com。我正在对实际的提要项目进行自定义编码,以赋予它们单独的样式等。
我想要做的是创建缩略图以进入提要。我的计划是检索提要中存在的任何图像,选择第一个,并将其用作 span 元素的背景图像(从而将其解析为方形纵横比)。但是,我不知道该怎么做。
是否有某种intra-post标签检索方法?我已经尝试了一些事情,但没有立即产生任何结果,所以我想我会在这里问。
It depends on the namespace of the feed. I did something similar with Simplepie for a twitter module a while a ago and used something like:
foreach ($simplepie->get_items() as $item) {
filter_xss($item->get_link(0, $rel = 'image'))
...
}
so you would need to see what attributes are in your feed items to search on. For reference, you can view the code in the module located here.