1
我试图设置用户会看到的RSS提要的样式。因此,他们只能看到帖子中的图像,所见即所得编辑器中的文字以及作为主题一部分的按钮。样式化RSS提要?
这里是从的single.php模板文件中的按钮:
<div class="bottomgift clearfix">
<a target="_blank" rel="nofollow" href="<?php getCustomField('Affiliate Link'); ?>" class="go-button">Go</a>
</div>
如何添加这一切样式的RSS源?
在functions.php的
function modRSS($content) {
global $post;
if (has_post_thumbnail($post->ID)){
$content = '<div>' . get_the_post_thumbnail($post->ID, 'full', array('style' => 'margin-bottom: 15px;')) . '</div>' . $content;
}
$content = $content . '<a href="' . getCustomField('Affiliate Link') . '">Go</a>';
return $content;
}
add_filter('the_excerpt_rss', 'modRSS');
add_filter('the_content_feed', 'modRSS');
今天我会试试这个,当我回到我的电脑,让你知道它是怎么回事!谢谢! – 2012-07-24 15:20:26
很酷,让我们知道。 – Foxinni 2012-07-25 11:31:09
等待客户对RSS设置的响应,但是当我将你的代码粘贴到functions.php中时,我在55行的functions.php中发现错误,这是我粘贴代码的地方。我测试了一个来自你链接的网站,这样做确实有效,但问题是当我发布新帖子时,RSS并没有更新,所以我无法测试它,看看它是否还能正常工作,这就是为什么一直存在延迟。今天应该得到答复,然后我会让你知道它如何去感谢! – 2012-07-30 17:48:05