我的RSS提要显示了一个XML标记,我想将其删除或清空。XML中的标记如下所示:
<wfw:commentRss>remove/this/uri</wfw:commentRss>
有方向正确的点吗?
我的RSS提要显示了一个XML标记,我想将其删除或清空。XML中的标记如下所示:
<wfw:commentRss>remove/this/uri</wfw:commentRss>
有方向正确的点吗?
完全删除标签会很不方便,因为它是硬编码的feed-rss2.php
模板文件。可以替换中的调用函数do_feed_rss2
钩子,但仍然需要分叉整个模板。
然而,很容易取消那里的内容。get_post_comments_feed_link()
通过过滤器传递输出,因此类似的操作应该可以完成(未测试):
add_action( \'do_feed_rss2\', function() {
add_filter( \'post_comments_feed_link\', \'__return_empty_string\' );
}, 9);
我正在做一个主题的除虫工作,我希望有人能帮助我。我使用JustinTadlock创建的这个函数在博客页面上显示自定义帖子类型,并且将wp debug设置为true,我会收到一个通知:未定义索引:suppress\\u filters消息。代码如下:// Custom Post Type for the public blog posts to show on Index or blog page add_filter( \'pre_get_posts\', \'my_get_posts\' );&