首页 > 解决方案 > 如何从提要页面中删除 rel="nofollow"

问题描述

页面中,每个链接都有rel="nofollow".

你们能告诉我如何从该页面中删除nofollow。

我正在使用 WordPress 他们。

希望能得到你身边的一些帮助

提前致谢

标签: wordpressnofollow

解决方案


要从链接中删除 nofollow,请在您当前活动的主题functions.php文件中添加以下代码。

rss 挂钩不允许更改标签内的内容,因此请为您的提要创建自定义模板。

/**
 * Deal with the custom RSS templates.
 */
function my_custom_rss() {

    if ( 'photos' === get_query_var( 'post_type' ) ) {
        get_template_part( 'feed', 'photos' );
    } else {
        get_template_part( 'feed', 'rss2' );
    }
}
remove_all_actions( 'do_feed_rss2' );
add_action( 'do_feed_rss2', 'my_custom_rss', 10, 1 );

如需更多帮助,请参阅此链接:单击此处

您可以从核心 wordpress 文件夹中获取自定义提要模板的内容/wp-includes/feed-rss2.php

我希望它会帮助你。


推荐阅读