RSS 聚合方便阅读者把所有文章(博客)都放在一起阅读,有优点也有缺点.我在 LEONAX 的博客上看到这篇帖子 http://leonax.net/p/7202/rss-output-title-only-from-now-on/ 后觉得非常有道理.所以就把我的博客站点的FEED ([1], [2], [3]) 也全改成只输出标题和链接.
这样的好处是强制用户到作者原网站上阅读: 一是可以参于评论,二是搜索引擎较友好(保护文章的原创性),三是可以看到RSS里没看到的一些CSS效果,比如这个.
方法很简单, 只要编辑 WORDPRESS 的模板 functions.php 里,在文件最后面加入:
1 2 3 4 5 6 7 8 9 10 11 | // https://HelloACM.com add_filter( 'the_content_feed', 'the_content_feed1' ); add_filter( 'the_excerpt_rss', 'the_excerpt_rss1'); function the_excerpt_rss1() { return ""; } function the_content_feed1($content) { return ""; } |
// https://HelloACM.com add_filter( 'the_content_feed', 'the_content_feed1' ); add_filter( 'the_excerpt_rss', 'the_excerpt_rss1'); function the_excerpt_rss1() { return ""; } function the_content_feed1($content) { return ""; }
注意只在博客设置页面里只能有两个选项, 全文输出或者显示摘要. 要做就做彻底点, 简单一点好.Less is More.
英文: https://helloacm.com/how-to-disable-content-output-in-rss-feed-for-wordpress/
强烈推荐
- 英国代购-畅购英伦
- TopCashBack 返现 (英国购物必备, 积少成多, 我2年来一共得了3000多英镑)
- Quidco 返现 (也是很不错的英国返现网站, 返现率高)
- 注册就送10美元, 免费使用2个月的 DigitalOcean 云主机(性价比超高, 每月只需5美元)
- 注册就送10美元, 免费使用4个月的 Vultr 云主机(性价比超高, 每月只需2.5美元)
- 注册就送10美元, 免费使用2个月的 阿里 云主机(性价比超高, 每月只需4.5美元)
- 注册就送20美元, 免费使用4个月的 Linode 云主机(性价比超高, 每月只需5美元) (折扣码: PodCastInit2022)
- PlusNet 英国光纤(超快, 超划算! 用户名 doctorlai)
- 刷了美国运通信用卡一年得到的积分 换了 485英镑
- 注册就送50英镑 – 英国最便宜最划算的电气提供商
- 能把比特币莱特币变现的银行卡! 不需要手续费就可以把虚拟货币法币兑换
微信公众号: 小赖子的英国生活和资讯 JustYYUK