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/
GD Star Rating
loading...
本文一共 233 个汉字, 你数一下对不对.loading...
上一篇: 翻出一支钢笔
下一篇: 公司购买了 VBSEDIT 软件
扫描二维码,分享本文到微信朋友圈