禁用评论RSS

发布于 2024-10-18 23:18:13 字数 333 浏览 2 评论 0原文

我使用它来自动显示 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

天生の放荡 2024-10-25 23:18:13

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";

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文