禁用评论RSS
我使用它来自动显示 header.php 中的 rss
automatic_feed_links();
,在标题中出现 feed=rss2 和 feed=comments-rss2
现在我只想禁用 comments-rss2 因为我不使用评论主题。
如果我使用 remove_action( 'wp_head', 'feed_links', 2 );
两者都会从头部删除。
我只想删除评论-rss2 -
找不到任何参考如何做到这一点。
有人知道吗?
i am using this to automatic display the rss in the header.php
automatic_feed_links();
in the header appears feed=rss2 and feed=comments-rss2
now i just want to disable the comments-rss2 since i dont use comments in the theme.
if i use remove_action( 'wp_head', 'feed_links', 2 );
both are removed from the head.
I just want to remove the comments-rss2 -
couldnt find any reference how to this.
anyone know?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
wp-includes/general-template.php 中的 feed_links 函数包含两个 feed 的 echo 命令,并且无法通过参数禁用。注释掉//这一行:(wp-includes/general-template.php #1614 for wp3.1)
echo '
feed_links function in wp-includes/general-template.php contains echo command for both feed and not be able to disable with argument. Comment out // this line: (wp-includes/general-template.php #1614 for wp3.1)
echo '<link rel="alternate" type="' . feed_content_type() . '" title="' . esc_attr(sprintf( $args['comstitle'], get_bloginfo('name'), $args['separator'] )) . '" href="' . get_feed_link( 'comments_' . get_default_feed() ) . "\" />\n";